Comment options. Shutdown time as variable
This commit is contained in:
15
backup.sh
15
backup.sh
@@ -6,11 +6,12 @@
|
|||||||
|
|
||||||
# Specify devices and their mount points
|
# Specify devices and their mount points
|
||||||
# and other settings
|
# and other settings
|
||||||
STORAGE_DEV="sda1"
|
STORAGE_DEV="sda1" # Name of the storage device
|
||||||
STORAGE_MOUNT_POINT="/media/storage"
|
STORAGE_MOUNT_POINT="/media/storage" # Mount point of the storage device
|
||||||
CARD_DEV="sdb1"
|
CARD_DEV="sdb1" # Name of the storage card
|
||||||
CARD_MOUNT_POINT="/media/card"
|
CARD_MOUNT_POINT="/media/card" # Mount point of the storage card
|
||||||
GEO_REF="GEO.JPG"
|
GEO_REF="GEO.JPG" # Name of the reference photo to be used for geotagging
|
||||||
|
SHUTD="5" # Minutes to wait before shutdown due to inactivity
|
||||||
|
|
||||||
# If there is a wpa_supplicant.conf file in the root of the storage device
|
# If there is a wpa_supplicant.conf file in the root of the storage device
|
||||||
# Rename the original config file,
|
# Rename the original config file,
|
||||||
@@ -26,8 +27,8 @@ fi
|
|||||||
# Set the ACT LED to heartbeat
|
# Set the ACT LED to heartbeat
|
||||||
sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger"
|
sudo sh -c "echo heartbeat > /sys/class/leds/led0/trigger"
|
||||||
|
|
||||||
# Shutdown after 5 minutes if no device is connected.
|
# Shutdown after a specified period of time (in minutes) if no device is connected.
|
||||||
sudo shutdown -h 5 "Shutdown is activated. To cancel: sudo shutdown -c"
|
sudo shutdown -h $SHUTD "Shutdown is activated. To cancel: sudo shutdown -c"
|
||||||
|
|
||||||
# Wait for a USB storage device (e.g., a USB flash drive)
|
# 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user