diff options
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/nmount | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/nmount b/plugins/nmount index e08966a..ce9f99e 100755 --- a/plugins/nmount +++ b/plugins/nmount @@ -1,7 +1,8 @@ #!/usr/bin/env sh # Description: Toggle mount status of a device using pmount -# If the device is mounted, it will be unmounted and vice versa. +# If the device is not mounted, it will be mounted. +# If the device is mounted, it will be unmounted and powered down. # # Shell: POSIX compliant # Author: Arun Prakash Jana @@ -19,7 +20,10 @@ echo if grep -qs "$dev " /proc/mounts; then pumount "$dev" - echo $dev unmounted. + if [ "$?" -eq "0" ]; then + udisksctl power-off -b /dev/"$dev" + echo $dev ejected. + fi else pmount "$dev" echo "$dev" mounted to "$(lsblk -n /dev/"$dev" | rev | cut -d' ' -f1 | rev)". |