My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env sh
  2. # Description: Toggle mount status of a device using pmount
  3. # If the device is mounted, it will be unmounted and vice versa.
  4. #
  5. # Shell: POSIX compliant
  6. # Author: Arun Prakash Jana
  7. lsblk
  8. echo
  9. echo -n "device (e.g. sdc2): "
  10. read dev
  11. if [ -z "$dev" ]; then
  12. exit 1
  13. fi
  14. echo
  15. if grep -qs "$dev " /proc/mounts; then
  16. pumount "$dev"
  17. echo $dev unmounted.
  18. else
  19. pmount "$dev"
  20. echo "$dev" mounted to "$(lsblk -n /dev/"$dev" | rev | cut -d' ' -f1 | rev)".
  21. fi
  22. read dummy