remount optional

This commit is contained in:
Vincent Riquer 2009-11-23 15:28:22 +01:00
parent ec774af02e
commit e567b44c47

View File

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