SHARE
TWEET

crypt.mount

Nargren Sep 21st, 2014 232 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #Script to mount/unmount EncFS encrypted volume(s)
  3.  
  4. #  _____            _____ ____  
  5. # | ____|_ __   ___|  ___/ ___|
  6. # |  _| | '_ \ / __| |_  \___ \
  7. # | |___| | | | (__|  _|  ___) |
  8. # |_____|_| |_|\___|_|   |____/          
  9.  
  10. #Nargren, 2014.06.22.
  11.  
  12. ############### CONFIGURE ##############
  13.  
  14. #Mount directory location
  15. mount=/tmp/crypt
  16.  
  17. #Encrypted directory location
  18. crypt=/home/$USER/.encrypted
  19.  
  20. #Deafault file manager
  21. filemanager=nautilus
  22.  
  23. ############### MAIN ##############
  24. echo "Tell me what ya need?"
  25. PS3='Select an option:'
  26. select main in "Mount" "Unmount" "Open Folder"
  27. do
  28. case $main in
  29.  
  30. "Mount")
  31. echo "Mounting at "$mount
  32. encfs $crypt $mount
  33. echo ""
  34. echo "
  35. 1) Mount
  36. 2) Unmount
  37. 3) Open Folder"
  38. ;;
  39.  
  40. "Unmount")
  41. echo "Unmounting..."
  42. fusermount -u /tmp/crypt
  43. echo "Volume has been unmounted!"
  44. echo ""
  45. echo "
  46. 1) Mount
  47. 2) Unmount
  48. 3) Open Folder"
  49. ;;
  50.  
  51. "Open Folder")
  52. echo "Opening "$mount"..."
  53. $filemanager $mount
  54. echo ""
  55. echo "
  56. 1) Mount
  57. 2) Unmount
  58. 3) Open Folder"
  59. ;;
  60. *) echo PEBKAC;;
  61. esac
  62. done
RAW Paste Data
Want to get better at Bash?
Learn to code Bash in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top