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