My build of nnn with minor changes
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
512 B

  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