Advertisement
Guest User

Mount Script

a guest
Mar 14th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  1. #!/bin/bash
  2. while true; do
  3.     read -p "Would you like to Mount, or Unmount? [M/U/E]::==>" mue
  4.     echo
  5.     case $mue in
  6.         [Mm]* ) sudo mount -t cifs //12.0.0.9/Backups -o username=anonymous,password=,uid=1000,gid=1000 ~/NAS/Backups; sudo mount -t cifs //12.0.0.9/Shared/ -o username=anonymous,password=,uid=1000,gid=1000 ~/NAS/Shared/; echo "$(tput setaf 2)$(tput setab 7)$(tput bold)$(tput smul)MOUNTED$(tput sgr 0)"; sleep 2; clear; exit;;
  7.         [Uu]* ) sudo umount ~/NAS/Backups; sudo umount ~/NAS/Shared; echo "$(tput setaf 1)$(tput setab 7)$(tput bold)$(tput smul)UNMOUNTED$(tput sgr 0)"; sleep 2; clear; exit;;
  8.         [Ee]* ) sleep .2; clear; exit;;
  9.         * ) echo "$(tput setaf 1)Please choose a valid response...$(tput sgr 0)";;
  10.     esac
  11. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement