diff options
Diffstat (limited to 'bin/wrappers')
-rwxr-xr-x | bin/wrappers/cryptsetup_mount | 7 | ||||
-rwxr-xr-x | bin/wrappers/cryptsetup_umount | 5 | ||||
-rwxr-xr-x | bin/wrappers/dwm_watch_binary | 17 |
3 files changed, 29 insertions, 0 deletions
diff --git a/bin/wrappers/cryptsetup_mount b/bin/wrappers/cryptsetup_mount new file mode 100755 index 0000000..e755daf --- /dev/null +++ b/bin/wrappers/cryptsetup_mount @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +# Mounts encrypted volume into dm-crypt +# First argument is the device name - /dev/* +# Second argument is the directory name desired + +cryptsetup open "$1" "$2" && mount --mkdir "/dev/mapper/$2" "/mnt/dm-crypt/$2" diff --git a/bin/wrappers/cryptsetup_umount b/bin/wrappers/cryptsetup_umount new file mode 100755 index 0000000..b186ad5 --- /dev/null +++ b/bin/wrappers/cryptsetup_umount @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +# Unmount the encrypted volume mounted at the given directory name + +umount "/mnt/dm-crypt/$1" && rmdir "/mnt/dm-crypt/$1" && cryptsetup close "$1" diff --git a/bin/wrappers/dwm_watch_binary b/bin/wrappers/dwm_watch_binary new file mode 100755 index 0000000..ebe34f0 --- /dev/null +++ b/bin/wrappers/dwm_watch_binary @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +# relaunch DWM if the binary changes, otherwise bail +csum="" +new_csum="$(sha1sum "$(which dwm)")" +while true +do + if [ "$csum" != "$new_csum" ] + then + csum=$new_csum + dwm + else + exit + fi + new_csum="$(sha1sum "$(which dwm)")" + sleep 5 +done |