Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.35 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ans=$(zenity --list --text "What share do you want to mount?" --radiolist --column "Select" --column "one" TRUE 'Software' FALSE 'BACKUP');
  4.     if [ $? = 1 ]; then
  5.         exit
  6.     elif [ $ans = 'Software' ]; then
  7.         address=$(zenity --entry --text "Enter The Address To The NAS" --entry-text "10.0.0.185" --title "Address");
  8.         username=$(zenity --entry --text "Enter The Username To The NAS" --entry-text "admin" --title "Username");
  9.         password=$(zenity --entry --text "Enter The Password To The Username" --title "Password")
  10.         mountpoint=$(zenity --enty --text "Enter The Mount Point" --entry-text "/mnt/smb/" --title "Mount Point");
  11.         sudo smbmount //$address/Software/ $mountpoint -o username=$username,password=$password,rw,uid=user
  12.     elif [ $ans = 'BACKUP' ]; then
  13.         address=$(zenity --entry --text "Enter The Address To The NAS" --entry-text "10.0.0.185" --title "Address");
  14.         username=$(zenity --entry --text "Enter The Username To The NAS" --entry-text "user" --title "Username");
  15.         password=$(zenity --entry --text "Enter The Password To The Username" --title "Password")
  16.         mountpoint=$(zenity --entry --text "Enter The Mount Point" --entry-text "/home/user/Desktop/NASbackup/" --title "Mount Point");
  17.         sudo smbmount //$address/BACKUP/ $mountpoint -o username=$username,password=$password,rw,uid=user
  18.     else
  19.         zenity --info --text "Invalid option! "
  20. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement