diff --git a/remote-backup b/remote-backup index e7a2c1c..0821fd0 100755 --- a/remote-backup +++ b/remote-backup @@ -65,17 +65,22 @@ source /etc/remote-backup.conf # ------------- the script itself -------------------------------------- # make sure we're running as root -if (( `$ID -u` != 0 )); then { $ECHO "Sorry, must be root. Exiting..."; exit; } fi - -# attempt to remount the RW mount point as RW; else abort -$MOUNT -o remount,rw $MOUNT_DEVICE $SNAPSHOT_RW ; -if (( $? )); then -{ - $ECHO "snapshot: could not remount $SNAPSHOT_RW readwrite"; - exit; -} -fi; +if [ ! $UID -eq 0 ] +then + $ECHO "Sorry, must be root. Exiting..." + exit +fi +if [[ "$REMOUNT" == "true" ]] +then + # attempt to remount the RW mount point as RW; else abort + $MOUNT -o remount,rw $MOUNT_DEVICE $SNAPSHOT_RW ; + if (( $? )) + then + $ECHO "snapshot: could not remount $SNAPSHOT_RW readwrite" + exit + fi +fi # rotating snapshots of /home (fixme: this should be more general)