Double-quote values
This commit is contained in:
@@ -31,15 +31,15 @@ sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger"
|
||||
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=$(ls /dev/* | grep "$STORAGE_DEV" | cut -d"/" -f3)
|
||||
while [ -z ${STORAGE} ]
|
||||
do
|
||||
sleep 1
|
||||
STORAGE=$(ls /dev/* | grep $STORAGE_DEV | cut -d"/" -f3)
|
||||
STORAGE=$(ls /dev/* | grep "$STORAGE_DEV" | cut -d"/" -f3)
|
||||
done
|
||||
|
||||
# When the USB storage device is detected, mount it
|
||||
mount /dev/$STORAGE_DEV $STORAGE_MOUNT_POINT
|
||||
mount /dev/"$STORAGE_DEV" "$STORAGE_MOUNT_POINT"
|
||||
|
||||
# Cancel shutdown
|
||||
sudo shutdown -c
|
||||
@@ -49,7 +49,7 @@ sudo sh -c "echo timer > /sys/class/leds/led0/trigger"
|
||||
sudo sh -c "echo 1000 > /sys/class/leds/led0/delay_on"
|
||||
|
||||
# Perform backup using rsync
|
||||
rsync -av $SOURCE_DIR $STORAGE_MOUNT_POINT
|
||||
rsync -av "$SOURCE_DIR" "$STORAGE_MOUNT_POINT"
|
||||
|
||||
# Turn off the ACT LED to indicate that the backup is completed
|
||||
sudo sh -c "echo 0 > /sys/class/leds/led0/brightness"
|
||||
|
||||
Reference in New Issue
Block a user