'scripts/card-backup.sh' updaten
This commit is contained in:
@@ -21,27 +21,13 @@
|
|||||||
# as well as other settings
|
# as well as other settings
|
||||||
|
|
||||||
STORAGE_MOUNT_POINT="/mnt/SMB" # Mount point of the storage device
|
STORAGE_MOUNT_POINT="/mnt/SMB" # Mount point of the storage device
|
||||||
|
|
||||||
CARD_DEV="sdb1" # Name of the storage card
|
CARD_DEV="sdb1" # Name of the storage card
|
||||||
|
|
||||||
CARD_MOUNT_POINT="/media/card" # Mount point 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
|
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
|
# Wait for a card reader or a camera
|
||||||
# takes first device found
|
# takes first device found
|
||||||
CARD_READER=($(ls /dev/* | grep "$CARD_DEV" | cut -d"/" -f3))
|
CARD_READER=($(ls /dev/* | grep "$CARD_DEV" | cut -d"/" -f3))
|
||||||
|
|||||||
Reference in New Issue
Block a user