mewl_hayabusa

goofys_mount

Aug 25th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.59 KB | None | 0 0
  1. #!/bin/sh
  2. MOUNT_POINT=/home/mastodon/wasabi/backups
  3. BUCKET=backups
  4. OPTION="--endpoint https://s3.wasabisys.com --profile wasabi"
  5.  
  6. /bin/mountpoint ${MOUNT_POINT}
  7. if [ 0 = $? ]
  8. then
  9.   echo `date --rfc-2822` ": keeping mount s3 via goofys"
  10.   return 0
  11. else
  12.   echo `date --rfc-2822` ": unexpected umount s3" 1>&2
  13.  
  14.   # try re-mount
  15.   echo "try remount goofys..." 1>&2
  16.   /bin/umount ${MOUNT_POINT}
  17.   /home/pleroma/bin/goofys ${OPTION} ${BUCKET} ${MOUNT_POINT}
  18.    if [ 0 = $? ]
  19.   then
  20.     echo "success remount goofys" 1>&2
  21.   else
  22.     echo "failed remount goofys" 1>&2
  23.   fi
  24.   return 1
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment