diff options
author | David Runge <david.runge@native-instruments.de> | 2018-11-24 14:19:45 +0100 |
---|---|---|
committer | David Runge <david.runge@native-instruments.de> | 2018-11-24 14:19:45 +0100 |
commit | f4fec3ab8e56e82bf7904c3c19876e2f4e13667d (patch) | |
tree | 23a4dd266333fc6cfeb5ee05c6000ced30724098 /bin/cs | |
parent | 31895b1b525ab673becdb10c7a421f71510f6354 (diff) | |
parent | de1f86528b58faa0844f24b9edb63e5837dd7444 (diff) | |
download | dotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.tar.gz dotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.tar.bz2 dotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.tar.xz dotfiles-f4fec3ab8e56e82bf7904c3c19876e2f4e13667d.zip |
Merge branch 'master' of git.sleepmap.de:config/dotfiles
* 'master' of git.sleepmap.de:config/dotfiles: (36 commits)
.config/packages-community.txt: Adding pd-lua.
.config/systemd/user/mpd@.service: Adding local override for mpd@ user service. Raising LimitRTPrio to 75, as some threads in mpd apparently require it.
.config/jack/*: Changing all configurations for jack@ user service (as its layout has changed).
.gitignore: Removing ignore of .config/systemd (time to add some local overrides).
.config/packages-aur.txt: Removing ssr (now in [community]).
.config/systemd/user/jack@.service: Adding a local jack@ user service, so no package is required.
.config/packages-community.txt: Adding dragonfly-reverb, libmusicxml, ssr and wolf-shaper.
.ncmpcpp/config: Switching to local visualizer fifo. Using visualizer_type ellipse.
.zsh.after/aliases.zsh: Removing useless pacsearch overloading.
bin/setup_screens: Fixing and simplifying various things with the help of shellcheck. Using a separate get_display function to retrieve DISPLAY.
bin/xorg_autolock: Properly quoting variables. Abstracting lock_cmd.
bin/xorg_lock: Properly quote variables. Rename variables for better readibility.
.xprofile: Repaired with the help of shellcheck.
.config/packages-community.txt: Adding marsyas.
.config/packages-aur.txt: Removing gmsynth.lv2 (now in community). Adding librenms and patroneo-git.
.config/packages-community.txt: Adding ams-lv2, beatslash-lv2, gmsynth.lv2, lib32-fluidsynth, lsp-plugins, lvtk, stk and removing ssmtp.
bin/cs: Fixing script according to shellcheck.
.config/packages-community.txt: Adding nextcloud-app-spreed.
.vim/addons-settings.vim: Adding supercollider settings for split in tmux.
.config/linuxsampler.org/Qsampler.conf: Remove, because it makes no sense in repo.
...
Diffstat (limited to 'bin/cs')
-rwxr-xr-x | bin/cs | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -19,7 +19,7 @@ function open_cryptdevice() { echo "Crypt device has already been opened: /dev/mapper/$2" echo "Continuing..." else - /usr/bin/sudo /usr/bin/cryptsetup luksOpen "/dev/disk/by-uuid/$1" $2 + /usr/bin/sudo /usr/bin/cryptsetup luksOpen "/dev/disk/by-uuid/$1" "$2" fi else echo "Error: Device $2 (UUID=$1) is not available." @@ -28,7 +28,7 @@ function open_cryptdevice() { } function close_cryptdevice() { - /usr/bin/sudo /usr/bin/cryptsetup luksClose $1 + /usr/bin/sudo /usr/bin/cryptsetup luksClose "$1" } function mount_cryptdevice() { @@ -50,35 +50,35 @@ function unmount_cryptdevice() { if [ -x "$HOME/.config/cs/pre_umount/$1" ]; then "$HOME/.config/cs/pre_umount/$1" fi - /usr/bin/sudo /usr/bin/umount /mnt/$1 + /usr/bin/sudo /usr/bin/umount "/mnt/$1" } function validate_cryptdevice_name() { - local _result_valid_name=$1 + local _result_valid_name="$1" local name_found=0 - local input_name=${2:-} + local input_name="${2:-}" for name in "${!devices[@]}"; do - if [ $name = "${input_name}" ]; then + if [ "$name" = "${input_name}" ]; then name_found=1 - eval $_result_valid_name="'$name_found'" + eval "$_result_valid_name"="$name_found" fi done } -validate_cryptdevice_name valid_name ${device_name} +validate_cryptdevice_name valid_name "${device_name}" if [ $valid_name -eq 0 ]; then echo "No such device: '$device_name'!" exit 1 fi -case $1 in +case "$command_name" in "open") - open_cryptdevice ${devices[${2}]} $2 - mount_cryptdevice $2 + open_cryptdevice "${devices[${2}]}" "$2" + mount_cryptdevice "$2" ;; "close") - unmount_cryptdevice $2 - close_cryptdevice $2 + unmount_cryptdevice "$2" + close_cryptdevice "$2" ;; *) echo "cs only understands 'open' and 'close'." |