Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- is_mounted=false
- if mount | grep -qs sda1
- then
- echo "sda1 is mounted. Type <u> to unmount; Enter to quit. "
- is_mounted=true
- else
- echo "sda1 is not mounted. Type <m> to mount; Enter to quit. "
- fi
- read choice
- if [[ $choice == "u" ]] && [[ "$is_mounted" == true ]]
- then
- if sudo umount /dev/disk/by-uuid/<here_goes_uuid>
- then
- echo "ESP unmounted."
- sleep 0.4
- fi
- elif [[ $choice == "m" ]] && [[ "$is_mounted" == false ]]
- then
- if sudo mount /dev/disk/by-uuid/<here_goes_uuid>
- then
- echo "ESP mounted."
- sleep 0.4
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement