diff --git a/.local/bin/scripts/moul b/.local/bin/scripts/moul index 48bf8a5..8c678c3 100755 --- a/.local/bin/scripts/moul +++ b/.local/bin/scripts/moul @@ -4,11 +4,11 @@ arg=$1 test "$arg" = "--help" && echo "$0 [mountpoint] [options...]" && exit 0 if test "$arg" = "-u" then - mountpoint="$2" - sudo umount --verbose "$mountpoint" - code=$? - sudo rm -df "$mountpoint" - exit $code + mountpoint="$2" + sudo umount --verbose "$mountpoint" + code=$? + sudo rm -df "$mountpoint" + exit $code fi if grep -e "LABEL=$arg[^\w/]" /etc/fstab @@ -17,13 +17,14 @@ fi if grep -e "[^\w=/]$arg[^\w/]" /etc/fstab then mount "$@"; exit $? fi -mountpoint="${2:-${MNT:-${XDG_RUNTIME_DIR}/mnt}/$arg}" +mountpoint="${2:-${MNT:-${XDG_RUNTIME_DIR}/mnt}/$(basename "$arg")}" if grep -e "[^\w=/]$mountpoint[^\w/]" /etc/fstab then shift; mount "$mountpoint" "$@"; code=$?; cd $mountpoint; exit $code fi case "$arg" in - (sd*|loop*|nvme*|mm*|md*|dm*|vg*) partition="/dev/$arg";; - (*) partition="-L $arg";; + (sd*|loop*|nvme*|mm*|md*|dm*|vg*) partition="/dev/$arg";; + (/dev/*) partition="$arg";; + (*) partition="-L $arg";; esac shift $(expr 2 \& $# \> 1 \| 1) #uid=$(id --user),gid=$(id --group), \ diff --git a/.local/bin/scripts/part b/.local/bin/scripts/part index f7b70d2..044b56e 100755 --- a/.local/bin/scripts/part +++ b/.local/bin/scripts/part @@ -6,4 +6,4 @@ case "$1" in (*) part=$1;; esac shift -sudo rlwrap parted $part "$@" +fdisk $part "$@"