Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/bash
- ##Script to mount cifs shares on linux
- unset username
- unset password
- DIRECTORY="/mnt/Zdrive" #local mount point
- ### Check if cifs package is installed
- if [ -f "/etc/redhat-release" ]; then
- yum install cifs-utils -y >/dev/null
- else
- apt-get install cifs-utils -y >/dev/null
- fi
- ##Check if mount point is there
- if [ -d "$DIRECTORY" ]; then
- : echo "$DIRECTORY present "
- else
- mkdir "$DIRECTORY"
- fi
- ## Get Credentials
- echo ""
- read -p "Enter Username(Windows):" username
- read -s -p "Enter Password: " password
- #Mount
- echo ""
- mount -t cifs -o vers=1.0,username=$username,password=$password,domain=example //example.com/Zdrive /mnt/Zdrive
- echo ""
Add Comment
Please, Sign In to add comment