test uuid of backupdevice (#3976)

This commit is contained in:
arno 2024-10-01 11:32:13 +02:00 committed by GitHub
parent 9039a0f1b2
commit d9e7b66143
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,10 +27,17 @@ if [ "$1" = "status" ]; then
# check if backup device is mounted
backupDeviceExists=$(df | grep -c "/mnt/backup")
if [ ${backupDeviceExists} -gt 0 ]; then
backupDeviceName=$(lsblk -o NAME,UUID | grep "${localBackupDeviceUUID}" | cut -d " " -f 1)
backupDeviceName=${backupDeviceName:2:4}
backupDeviceIsBackupDevice=$(df | grep -c ${backupDeviceName})
if [ ${backupDeviceIsBackupDevice} -gt 0 ]; then
echo "isMounted=1"
else
echo "isMounted=0"
fi
else
echo "isMounted=0"
fi
else
echo "backupdevice=0"