a guest Jan 14th, 2013 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # (C) Misha Gale, 2013
- # Available under the "I give no fucks" license.
- # The following three variables will need to be modified according to your backup settings. See
- # https://panel.bitfolk.com/backups/
- MOUNTS="hourly.0 hourly.1 hourly.2 hourly.3 hourly.4 hourly.5 daily.0 daily.1 daily.2 daily.3 daily.4 daily.5 daily.6 weekly.0 weekly.1 weekly.2 weekly.3 monthly.0 monthly.1 monthly.2 monthly.3 monthly.4 monthly.5"
- INVOKEDAS=`basename $0`
- if [ "$MODE" != "mount" -a "$MODE" != "unmount" ]; then
- if [ "$INVOKEDAS" = "unmountbackups" ]; then
- elif [ "$INVOKEDAS" = "mountbackups" ]; then
- echo "USAGE: $INVOKEDAS <mount | unmount>"
- exit 1;
- for MOUNT in $MOUNTS; do
- if mount|grep "$MOUNTDIR">/dev/null; then #unmount if already mounted
- umount $MOUNTDIR
- if [ "$MODE" = "mount" ]; then
- mkdir -p $MOUNTDIR
- mount $BASE/$MOUNT/$IP $MOUNTDIR
- if [ "$MODE" = "unmount" -a -d "$MOUNTDIR" ]; then
- rmdir $MOUNTDIR
RAW Paste Data