bin: update partition management utilities
This commit is contained in:
parent
900e73c018
commit
9c2347e99c
|
@ -17,12 +17,13 @@ fi
|
||||||
if grep -e "[^\w=/]$arg[^\w/]" /etc/fstab
|
if grep -e "[^\w=/]$arg[^\w/]" /etc/fstab
|
||||||
then mount "$@"; exit $?
|
then mount "$@"; exit $?
|
||||||
fi
|
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
|
if grep -e "[^\w=/]$mountpoint[^\w/]" /etc/fstab
|
||||||
then shift; mount "$mountpoint" "$@"; code=$?; cd $mountpoint; exit $code
|
then shift; mount "$mountpoint" "$@"; code=$?; cd $mountpoint; exit $code
|
||||||
fi
|
fi
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
(sd*|loop*|nvme*|mm*|md*|dm*|vg*) partition="/dev/$arg";;
|
(sd*|loop*|nvme*|mm*|md*|dm*|vg*) partition="/dev/$arg";;
|
||||||
|
(/dev/*) partition="$arg";;
|
||||||
(*) partition="-L $arg";;
|
(*) partition="-L $arg";;
|
||||||
esac
|
esac
|
||||||
shift $(expr 2 \& $# \> 1 \| 1)
|
shift $(expr 2 \& $# \> 1 \| 1)
|
||||||
|
|
|
@ -6,4 +6,4 @@ case "$1" in
|
||||||
(*) part=$1;;
|
(*) part=$1;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
sudo rlwrap parted $part "$@"
|
fdisk $part "$@"
|
||||||
|
|
Loading…
Reference in New Issue