mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Run nmount in a loop
This commit is contained in:
parent
0e8cb05045
commit
747490a180
|
@ -12,22 +12,24 @@ echo
|
||||||
echo -n "device (e.g. sdc2): "
|
echo -n "device (e.g. sdc2): "
|
||||||
read dev
|
read dev
|
||||||
|
|
||||||
if [ -z "$dev" ]; then
|
while ! [ -z "$dev" ]
|
||||||
exit 1
|
do
|
||||||
fi
|
if grep -qs "$dev " /proc/mounts; then
|
||||||
|
|
||||||
echo
|
|
||||||
|
|
||||||
if grep -qs "$dev " /proc/mounts; then
|
|
||||||
sync
|
sync
|
||||||
pumount "$dev"
|
pumount "$dev"
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
|
echo "$dev" unmounted.
|
||||||
udisksctl power-off -b /dev/"$dev"
|
udisksctl power-off -b /dev/"$dev"
|
||||||
echo $dev ejected.
|
if [ "$?" -eq "0" ]; then
|
||||||
|
echo "$dev" ejected.
|
||||||
fi
|
fi
|
||||||
else
|
fi
|
||||||
|
else
|
||||||
pmount "$dev"
|
pmount "$dev"
|
||||||
echo "$dev" mounted to "$(lsblk -n /dev/"$dev" | rev | cut -d' ' -f1 | rev)".
|
echo "$dev" mounted to "$(lsblk -n /dev/"$dev" | rev | cut -d' ' -f1 | rev)".
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read dummy
|
echo
|
||||||
|
echo -n "next device: "
|
||||||
|
read dev
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in a new issue