diff options
author | David Runge <dave@sleepmap.de> | 2018-01-21 20:00:05 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2018-01-21 20:00:05 +0100 |
commit | 88c2854c380215fecbe26101ef2ef6197a6907a3 (patch) | |
tree | 013249c450ce129533e65c9508d577112a0278f9 | |
parent | 5483272cc7d2c4668b437c3ac79a7e5bdadf951b (diff) | |
download | dotfiles-88c2854c380215fecbe26101ef2ef6197a6907a3.tar.gz dotfiles-88c2854c380215fecbe26101ef2ef6197a6907a3.tar.bz2 dotfiles-88c2854c380215fecbe26101ef2ef6197a6907a3.tar.xz dotfiles-88c2854c380215fecbe26101ef2ef6197a6907a3.zip |
bin/cs: Adding the automatic creation of mountpoints if not available yet.
-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 |