added turn off backup device

This commit is contained in:
rootzoll 2020-07-04 14:03:41 +02:00
parent ce8720604a
commit 0c3f351267
2 changed files with 17 additions and 4 deletions

View file

@ -232,9 +232,8 @@ do
echo "OK channel.backup copied to '${localBackupPath}' and '{$localTimestampedPath}' and '/boot/channel.backup'"
# check if a additional local backup target is set
# parameter in raspiblitz.conf:
# localBackupDeviceUUID='[DEVICEUUID]'
if [ "${localBackupDeviceUUID}" != "" ] && [ "${localBackupDeviceUUID}" != "off" ];; then
# see ./config.scripts/blitz.backupdevice.sh
if [ "${localBackupDeviceUUID}" != "" ] && [ "${localBackupDeviceUUID}" != "off" ]; then
# check if device got mounted on "/mnt/backup" (gets mounted by _bootstrap.sh)
backupDeviceExists=$(df | grep -c "/mnt/backup")

View file

@ -73,6 +73,18 @@ if [ "$1" = "on" ]; then
# select and format device if UUID is not given
uuid=$2
if [ "${uuid}" == "" ]; then
# get status data
source <(sudo /home/admin/config.scripts/blitz.backupdevice.sh status)
if [ ${backupdevice} -eq 1 ]; then
echo "error='already on'"
exit 1
fi
echo "# TODO: dialog to connect, choose and format device"
exit 1
fi
@ -180,8 +192,10 @@ fi
#########################
if [ "$1" = "off" ]; then
echo "# BACKUP DEVICE REMOVE"
sudo sed -i "s/^localBackupDeviceUUID=.*/localBackupDeviceUUID=off/g" /mnt/hdd/raspiblitz.conf
sudo umount /mnt/backup 2>/dev/null
echo "# OK backup device is off"
exit 0
fi