Remove mount share. Add config

This commit is contained in:
Dmitri Popov
2018-01-29 15:45:55 +01:00
committed by GitHub
parent 1d84ece06b
commit 04feb7c260

View File

@@ -5,10 +5,7 @@
# to install the required packages and configure the system.
# Specify devices and their mount points
STORAGE_DEV="sda1"
STORAGE_MOUNT_POINT="/media/storage"
CARD_DEV="sdb1"
CARD_MOUNT_POINT="/media/card"
source config.cfg
# If there is a wpa_supplicant.conf file in the root of the storage device
# Rename the original config file,
@@ -21,17 +18,6 @@ if [ -f "$STORAGE_MOUNT_POINT/wpa_supplicant.conf" ]; then
reboot
fi
# If there is a nfs_mount file in the root of the storage device
# Read the mount command and mount an NFS export
if [ -f "$STORAGE_MOUNT_POINT/share_mount" ]; then
sudo sh -c "echo 100 > /sys/class/leds/led0/delay_on"
MOUNT_COMMAND=$(head -n 1 "$STORAGE_MOUNT_POINT/share_mount")
sudo $MOUNT_COMMAND
SHARE_MOUNT_POINT=`echo "$MOUNT_COMMAND" cut -d" " -f5`
else
SHARE_MOUNT_POINT=""
fi
# Set the ACT LED to heartbeat
sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger"
@@ -87,12 +73,6 @@ sudo lsblk > lsblk.log
# Perform backup using rsync
rsync -av --exclude "*.id" $CARD_MOUNT_POINT/ $BACKUP_PATH
# If an NFS export is mounted
# Back up files to it
if [ ! -z "$SHARE_MOUNT_POINT" ]; then
rsync -av --exclude "*.id" $BACKUP_PATH/ $SHARE_MOUNT_POINT
fi
# Turn off the ACT LED to indicate that the backup is completed
sudo sh -c "echo 0 > /sys/class/leds/led0/brightness"
fi