From 2097b0ebfdd07ae7a8295c26703d8d88ee7a5f8f Mon Sep 17 00:00:00 2001 From: iceyrazor Date: Wed, 10 Jun 2026 00:48:19 -0500 Subject: Squashed commit of the following: made all scripts mostly posix moved from gajim to dino --- env/.local/bin/scripts/dmount | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'env/.local/bin/scripts/dmount') 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 -- cgit v1.3