diff --git a/README.md b/README.md
index afdb448..477e5c5 100644
--- a/README.md
+++ b/README.md
@@ -47,13 +47,11 @@ The exact steps depend on the backup mode.
### Remote control mode
-1. Point the browser to *http://[IP-ADDRESS]:8080* (replace *[IP-ADDRESS]* with the actual IP address of the Raspberry Pi)
-2. Start the desired backup mode by pressing the appropriate button.
+1. Point the browser to *http://127.0.0.1:8000* (replace *127.0.0.1* with the actual IP address of the Raspberry Pi).
+2. Start the desired action by pressing the appropriate button.
-The remote control mode gives you access to the **Device backup** action that backs up the */home/pi/BACKUP* folder on the Raspberry Pi to an external storage device. This can be useful when you transfer files in the camera backup mode, and later want to back up the transferred files to a external storage device.
-
## Problems?
Please report bugs and issues in the [Issues](https://github.com/dmpop/little-backup-box/issues) section.
diff --git a/img/rc.png b/img/rc.png
index f07794d..75c90a9 100644
Binary files a/img/rc.png and b/img/rc.png differ
diff --git a/install-little-backup-box.sh b/install-little-backup-box.sh
index 467b168..ec834d5 100755
--- a/install-little-backup-box.sh
+++ b/install-little-backup-box.sh
@@ -13,10 +13,26 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
+echo "----------------------"
+echo "Updating the system..."
+echo "----------------------"
+
sudo apt update
sudo apt dist-upgrade -y
sudo apt update
-sudo apt install acl git-core screen rsync exfat-fuse exfat-utils ntfs-3g gphoto2 libimage-exiftool-perl dialog php7.1 minidlna -y
+
+echo "-----------------------------------"
+echo "Installing the required packages..."
+echo "-----------------------------------"
+
+sudo apt install acl git-core screen rsync exfat-fuse exfat-utils ntfs-3g gphoto2 libimage-exiftool-perl dialog php minidlna -y
+
+echo "Enter user name (e.g., pi) and press [ENTER]:"
+read USERNAME
+
+if [ -z "$USERNAME" ]; then
+ USERNAME="pi"
+ fi
echo "------------------------------------"
echo "Creating the required directories..."
@@ -24,13 +40,9 @@ echo "------------------------------------"
sudo mkdir /media/card
sudo mkdir /media/storage
-sudo chown -R $USER:users /media/storage
+sudo chown -R $USERNAME:users /media/storage
sudo chmod -R 775 /media/storage
-sudo setfacl -Rdm g:$USER:rw /media/storage
-
-echo "-----------------------"
-echo "Configuring minidlna..."
-echo "-----------------------"
+sudo setfacl -Rdm g:$USERNAME:rw /media/storage
sudo sed -i 's|'media_dir=/var/lib/minidlna'|'media_dir=/media/storage'|' /etc/minidlna.conf
sudo service minidlna start
@@ -64,19 +76,19 @@ CHOICE=$(dialog --clear \
clear
case $CHOICE in
1)
- crontab -l | { cat; echo "#@reboot sudo /home/"$USER"/little-backup-box/scripts/card-backup.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
- crontab -l | { cat; echo "#@reboot sudo /home/"$USER"/little-backup-box/scripts/camera-backup.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
- crontab -l | { cat; echo "@reboot sudo /home/"$USER"/little-backup-box/scripts/php.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "#@reboot sudo /home/"$USERNAME"/little-backup-box/scripts/card-backup.sh >> /home/"$USERNAME"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "#@reboot sudo /home/"$USERNAME"/little-backup-box/scripts/camera-backup.sh >> /home/"$USERNAME"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "@reboot cd /home/"$USERNAME"/little-backup-box/scripts && sudo php -S 0.0.0.0:8000"; } | crontab
;;
2)
- crontab -l | { cat; echo "@reboot sudo /home/"$USER"/little-backup-box/scripts/card-backup.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
- crontab -l | { cat; echo "#@reboot sudo /home/"$USER"/little-backup-box/scripts/camera-backup.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
- crontab -l | { cat; echo "#@reboot sudo /home/"$USER"/little-backup-box/scripts/php.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "@reboot sudo /home/"$USERNAME"/little-backup-box/scripts/card-backup.sh >> /home/"$USERNAME"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "#@reboot sudo /home/"$USERNAME"/little-backup-box/scripts/camera-backup.sh >> /home/"$USERNAME"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "#@reboot cd /home/"$USERNAME"/little-backup-box/scripts && sudo php -S 0.0.0.0:8000"; } | crontab
;;
3)
- crontab -l | { cat; echo "#@reboot sudo /home/"$USER"/little-backup-box/scripts/card-backup.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
- crontab -l | { cat; echo "@reboot sudo /home/"$USER"/little-backup-box/scripts/camera-backup.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
- crontab -l | { cat; echo "#@reboot sudo /home/"$USER"/little-backup-box/scripts/php.sh >> /home/"$USER"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "#@reboot sudo /home/"$USERNAME"/little-backup-box/scripts/card-backup.sh >> /home/"$USERNAME"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "@reboot sudo /home/"$USERNAME"/little-backup-box/scripts/camera-backup.sh >> /home/"$USERNAME"/little-backup-box.log 2>&1"; } | crontab
+ crontab -l | { cat; echo "#@reboot cd /home/"$USERNAME"/little-backup-box/scripts && sudo php -S 0.0.0.0:8000"; } | crontab
;;
esac
diff --git a/scripts/index.php b/scripts/index.php
index 8f2abf6..1535757 100644
--- a/scripts/index.php
+++ b/scripts/index.php
@@ -47,14 +47,14 @@
&1 & echo $!');
}
if (isset($_POST['camerabackup']))
{
- shell_exec('sudo ./camera-backup.sh');
+ shell_exec('sudo ./camera-backup.sh 2>&1 & echo $!');
}
if (isset($_POST['shutdown']))
{
- shell_exec('sudo shutdown -h now');
+ shell_exec('sudo shutdown -h now 2>&1 & echo $!');
}
?>
diff --git a/scripts/php.sh b/scripts/php.sh
deleted file mode 100644
index bef2593..0000000
--- a/scripts/php.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/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 .
-
-while :
-do
- if [[ ! $(pgrep php) ]]; then
- cd /home/$USER/little-backup-box/script/
- php -S localhost:8000
- fi
-done