diff options
Diffstat (limited to 'bin/cs')
-rwxr-xr-x | bin/cs | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -8,6 +8,8 @@ command_name=${1:-} device_name=${2:-} . ~/.config/cs.conf +#TODO: do sanity checks on mountpoints and (dm) devices +#TODO: display list of devices available, if no argument given function open_cryptdevice() { if [ -L "/dev/disk/by-uuid/$1" ]; then @@ -24,7 +26,10 @@ function close_cryptdevice() { function mount_cryptdevice() { if [[ -e "/dev/mapper/$1" ]]; then - sudo mount /dev/mapper/$1 /mnt/$1 + if [[ ! -d "/mnt/$1" ]]; then + sudo mkdir "/mnt/$1" + fi + sudo mount "/dev/mapper/$1" "/mnt/$1" if [ $1 = "media" ]; then sudo mount --bind /mnt/media/music /mnt/music sudo mount --bind /mnt/media/photos /mnt/photos @@ -80,5 +85,3 @@ esac exit 0 -#TODO: create mount point if not available -#TODO: display list of devices available, if no argument given |