'scripts/card-backup.sh' updaten

This commit is contained in:
2019-06-01 12:59:15 +00:00
parent 68d99da5ff
commit 79d2d8a965

View File

@@ -21,27 +21,13 @@
# as well as other settings
STORAGE_MOUNT_POINT="/mnt/SMB" # Mount point of the storage device
CARD_DEV="sdb1" # Name of the storage card
CARD_MOUNT_POINT="/media/card" # Mount point of the storage card
SHUTD="5" # Minutes to wait before shutdown due to inactivity
# Shutdown after a specified period of time (in minutes) if no device is connected.
sudo shutdown -h $SHUTD "Shutdown is activated. To cancel: sudo shutdown -c"
# Wait for a USB storage device (e.g., a USB flash drive)
STORAGE=$(ls /dev/* | grep "$STORAGE_DEV" | cut -d"/" -f3)
#STORAGE=$(lsblk -x SIZE | grep sd[a-z]1 | awk '{print $1}' | sort | head -n 1)
while [ -z "${STORAGE}" ]
do
sleep 1
STORAGE=$(ls /dev/* | grep "$STORAGE_DEV" | cut -d"/" -f3)
done
# When the USB storage device is detected, mount it
# Cancel shutdown
sudo shutdown -c
# Wait for a card reader or a camera
# takes first device found
CARD_READER=($(ls /dev/* | grep "$CARD_DEV" | cut -d"/" -f3))