Files
Server-APP/install-photo-import-tool.sh

60 lines
1.8 KiB
Bash

#!/usr/bin/env bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
echo "----------------------"
echo "Updating the system..."
echo "----------------------"
apt update
apt dist-upgrade -y
apt update
echo "-----------------------------------"
echo "Installing the required packages..."
echo "-----------------------------------"
apt install acl screen rsync exfat-fuse exfat-utils ntfs-3g gphoto2 libimage-exiftool-perl dialog php cifs-utils sudo -y
USER="root"
mkdir /media/card
echo "-----------------------------"
echo "Fetching Little Backup Box..."
echo "-----------------------------"
cd
git clone https://trans.bprieshof.nl/gitea/brammp/little-backup-box-Bram.git
mkdir /mnt/SMB
cat > /etc/network/if-up.d/mountsmb <<- "EOF"
#! /bin/sh
mount -t cifs -o username=import,password=importpw,iocharset=utf8,sec=ntlmssp,file_mode=0775,dir_mode=0775 //192.168.2.144/Data /mnt/SMB
exit 0
EOF
cat > /etc/network/if-up.d/startphpweb <<- "EOF"
#! /bin/sh
cd /root/little-backup-box-Bram/scripts && php -S 0.0.0.0:8000 &
exit 0
EOF
echo "---------------------------------------------"
echo "All done! The system will reboot in 1 minute."
echo "---------------------------------------------"
shutdown -r 1