mountUnmountGoogleDrive.sh 628 B

12345678910111213141516
  1. #!/bin/bash
  2. # Mounts GoogleDrive
  3. google-drive-ocamlfuse ~/GoogleDrive/ 2> ~/.myScripts/GoogleDriveStatus.txt 1> ~/.myScripts/GoogleDriveStatus.txt
  4. isMounted=`cat ~/.myScripts/GoogleDriveStatus.txt`
  5. if [[ -z $isMounted ]] #if not mounted (no errors)
  6. then
  7. notify-send -i dialog-information "GoogleDrive mounted successfully"
  8. # notify-send -i dialog-information "$isMounted"
  9. else #if mounted
  10. # notify-send -i dialog-information "$isMounted"
  11. fusermount -u ~/GoogleDrive/ #unmount GoogleDrive
  12. # echo "" > ~/.myScripts/GoogleDriveStatus.txt
  13. notify-send -i dialog-information "GoogleDrive unmounted successfully"
  14. fi