mount-RaidBox 829 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. # http://www.absurde.org/2012/10/08/automatiser-ses-donnees-cryptees-feat-crypsetup-udev-automount/
  3. #!/bin/sh
  4. if [ "$1" = "open" ]; then
  5. # if [ "$2" ]; then
  6. echo "opening encrypted partition $2"
  7. #sudo cryptsetup luksOpen $2 RaidBox
  8. sudo cryptsetup luksOpen /dev/disk/by-uuid/67f46d1d-0408-4e62-ba34-deca394b2455 RaidBox
  9. echo "mounting RaidBox to /mnt/RaidBox"
  10. sudo mount /dev/mapper/RaidBox /mnt/RaidBox
  11. echo "done, $2 available at /mnt/RaidBox"
  12. #else
  13. # echo "Please give the device partition to open (eg: /dev/sdc1)"
  14. #fi
  15. elif [ "$1" = "close" ]; then
  16. echo "unmounting /mnt/RaidBox"
  17. sudo umount /mnt/RaidBox
  18. echo "Closing encrypted RaidBox"
  19. sudo cryptsetup close RaidBox
  20. else
  21. echo "please choose a command : open or close"
  22. fi