From 1cca9e4b72b106374f203890b266f18609deefe3 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 22 Nov 2019 02:14:25 +0530 Subject: shellcheck fixes --- plugins/nmount | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'plugins/nmount') diff --git a/plugins/nmount b/plugins/nmount index 9fb4e90..3f638bf 100755 --- a/plugins/nmount +++ b/plugins/nmount @@ -20,10 +20,9 @@ prompt="device name ['l' lists]: " lsblk -echo -echo "Make sure you aren't still in the mounted device." -echo -n "$prompt" -read dev +printf "\nMake sure you aren't still in the mounted device." +printf "%s" "$prompt" +read -r dev while ! [ -z "$dev" ] do @@ -34,11 +33,11 @@ do else if grep -qs "$dev " /proc/mounts; then sync - pumount "$dev" - if [ "$?" -eq "0" ]; then + if pumount "$dev" + then echo "$dev" unmounted. - udisksctl power-off -b /dev/"$dev" - if [ "$?" -eq "0" ]; then + if udisksctl power-off -b /dev/"$dev" + then echo "$dev" ejected. fi fi @@ -49,6 +48,6 @@ do fi echo - echo -n "$prompt" - read dev + printf "%s" "$prompt" + read -r dev done -- cgit v1.3.1