diff options
| author | nic <ra@afu.re> | 2024-05-11 22:41:54 -0400 |
|---|---|---|
| committer | nic <ra@afu.re> | 2024-05-11 22:41:54 -0400 |
| commit | 41111989d02a6ad1e66b37dc58a21dd761d8f573 (patch) | |
| tree | 353697dd6a7e5d63c1fa48cf722881649a47cd26 /.local/bin/mounter | |
| parent | a2715adbab22946bd168d07c5264e1b8b4c9288f (diff) | |
now using sudo
Diffstat (limited to '.local/bin/mounter')
| -rwxr-xr-x | .local/bin/mounter | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/.local/bin/mounter b/.local/bin/mounter index 246680e..3972784 100755 --- a/.local/bin/mounter +++ b/.local/bin/mounter @@ -68,13 +68,13 @@ getmount(){ test -n "$mp" if [ ! -d "$mp" ]; then mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") - [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || doas mkdir -p "$mp") + [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") fi } attemptmount(){ # Attempt to mount without a mountpoint, to see if drive is in fstab. - doas mount "$chosen" || return 1 + sudo -A mount "$chosen" || return 1 notify-send "💾Drive Mounted." "$chosen mounted." exit } @@ -84,7 +84,7 @@ case "$chosen" in chosen="${chosen%% *}" chosen="${chosen:1}" # This is a bashism. attemptmount || getmount - doas mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" + sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" notify-send "💾Drive Mounted." "$chosen mounted to $mp." ;; @@ -98,12 +98,12 @@ case "$chosen" in done # Decrypt in a terminal window - ${TERMINAL:-st} -n floatterm -g 60x1 -e doas cryptsetup open "$chosen" "usb$num" + ${TERMINAL:-st} -n floatterm -g 60x1 -e sudo cryptsetup open "$chosen" "usb$num" # Check if now decrypted. test -b "/dev/mapper/usb$num" attemptmount || getmount - doas mount "/dev/mapper/usb$num" "$mp" -o uid="$(id -u)",gid="$(id -g)" + sudo -A mount "/dev/mapper/usb$num" "$mp" -o uid="$(id -u)",gid="$(id -g)" notify-send "🔓Decrypted drive Mounted." "$chosen decrypted and mounted to $mp." ;; @@ -112,7 +112,7 @@ case "$chosen" in getmount number="${chosen%%:*}" number="${chosen:1}" # This is a bashism. - doas simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$(escape "$chosen")" --device "$number" "$mp" + sudo -A simple-mtpfs -o allow_other -o fsname="simple-mtpfs-$(escape "$chosen")" --device "$number" "$mp" notify-send "🤖 Android Mounted." "Android device mounted to $mp." ;; esac |
