summaryrefslogtreecommitdiff
path: root/mounter.sh
diff options
context:
space:
mode:
authorAleksei <alex3kov@zoho.com>2024-05-01 07:48:00 +0300
committerAleksei <alex3kov@zoho.com>2024-05-01 07:48:00 +0300
commit5d74a62d8b23df4ca836250c7aedd60e9bcd2428 (patch)
treee3900e85bea012d5beb50c524adbf5ae0812644e /mounter.sh
parent3c2613d76bd4d5bab59c4ded59a9098251253108 (diff)
Diffstat (limited to 'mounter.sh')
-rwxr-xr-xmounter.sh21
1 files changed, 9 insertions, 12 deletions
diff --git a/mounter.sh b/mounter.sh
index 87e4418..b609765 100755
--- a/mounter.sh
+++ b/mounter.sh
@@ -13,8 +13,8 @@ CHOICE=$(lsblk --json -o LABEL,PATH,SIZE,FSTYPE,TYPE,PARTLABEL,MOUNTPOINT |
.label!="partestroot" and
.label!="debian-root" and
.label!="partestboot" and
- .partlabel!="EFI" and
.partlabel!="boot" and
+ .partlabel!="EFI" and
.partlabel!="arch-root-amd64" and
.partlabel!="EFI system partition" and
.partlabel!="McAfeeEpeReserved" and
@@ -32,17 +32,14 @@ printf "DEV: %s\n" "$DEV"
LABEL=$(lsblk -n -oLABEL $DEV)
[ -z "$LABEL" ] && LABEL=$(lsblk -n -oUUID $DEV)
FSTYPE=$(lsblk -n -oFSTYPE $DEV)
-[ "$FSTYPE" = "vfat" ] && {
- mountargs="-t vfat -oiocharset=utf8,uid=$(id -u)"
-}
+case $FSTYPE in
+ 'vfat'|'exfat'|'ntfs')
+ mountargs="uid=$(id -u)"
+ ;;
+ *)
+ ;;
+esac
MDIR=$HOME/media/$LABEL
mkdir $MDIR 2>/dev/null
-doas /usr/bin/mount $mountargs $DEV $MDIR
+doas /usr/bin/mount -o $mountargs $DEV $MDIR
notify-send -t 4000 "$?"
-#cmd="doas /usr/bin/mount $DEV $MDIR 2>&1"
-#cmd="udisksctl mount -b $DEV 2>&1"
-#printf "cmd: %s\n" "$cmd"
-#msg="$($cmd)"
-#notify-send -t 4000 "$msg"
-#msg="$(lsusb -tv|grep -E 'uas|usb-storage' -A1)"
-#notify-send -t 4000 "$msg"