diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-11-22 02:14:25 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-11-22 11:13:34 +0530 |
commit | 1cca9e4b72b106374f203890b266f18609deefe3 (patch) | |
tree | 9f281f4b4de296c54d13dc9c7e214f58835636a7 /plugins/nmount | |
parent | ee2dcb1de7d3e82b330f49ee9fb5dfd4608207ff (diff) | |
download | nnn-1cca9e4b72b106374f203890b266f18609deefe3.tar.gz |
shellcheck fixes
Diffstat (limited to 'plugins/nmount')
-rwxr-xr-x | plugins/nmount | 19 |
1 files changed, 9 insertions, 10 deletions
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 |