diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-06-10 00:48:19 -0500 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-06-10 00:48:19 -0500 |
| commit | 2097b0ebfdd07ae7a8295c26703d8d88ee7a5f8f (patch) | |
| tree | 97edcae29f2817f045e0fda462609679935a6fb1 /env/.local/bin/scripts/dmount | |
| parent | 09156e6cea71093079af580acdd6d4a8594e14b9 (diff) | |
Squashed commit of the following:
made all scripts mostly posix
moved from gajim to dino
Diffstat (limited to 'env/.local/bin/scripts/dmount')
| -rwxr-xr-x | env/.local/bin/scripts/dmount | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/env/.local/bin/scripts/dmount b/env/.local/bin/scripts/dmount index b157208..863c35f 100755 --- a/env/.local/bin/scripts/dmount +++ b/env/.local/bin/scripts/dmount @@ -1,6 +1,6 @@ #!/bin/sh sudo="sudo" -[ doas ] && sudo="doas" +which doas && sudo="doas" umo=0 @@ -8,13 +8,16 @@ while getopts "u" opt; do case "$opt" in u) umo=1 ;; + *) echo invalid arg + exit + ;; esac done shift $((OPTIND-1)) [ "${1:-}" = "--" ] && shift -if [ $umo == 1 ]; then +if [ $umo = 1 ]; then nf=4 else nf=3 @@ -24,12 +27,12 @@ fi parts="$(lsblk -rno path,size,type,mountpoint | grep -e part -e lvm | awk "NF==$nf {print \$1, \$2, \$3, \$4}")" # choice="$(printf "$parts" | rofi -dmenu "beans" | sed 's/ .*//')" -choice="$(printf "$parts" | fzf | sed 's/ .*//')" +choice="$(printf -- "%s" "$parts" | fzf | sed 's/ .*//')" -[ "$choice" == "" ] && exit 0 +[ "$choice" = "" ] && exit 0 -if [ $umo == 1 ]; then - $sudo umount $choice +if [ $umo = 1 ]; then + $sudo umount "$choice" else - $sudo mount $choice /mnts/flash + $sudo mount "$choice" /mnts/flash fi |
