Advertisement
v1ral_ITS

Easy VPN GUI Bash Script

Aug 13th, 2018
4,532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.06 KB | None | 0 0
  1. #!/bin/bash
  2. ####################################
  3. #                    
  4. # START                
  5. # g0ne_@p0stal <v1ral_ITS>        
  6. # ImPerialTeKSolutions@outlook.com
  7. #                  
  8. ####################################
  9. echo "          #              #      "
  10. echo "          ################    ####"
  11. echo "          ################    ####"
  12. echo "          ################     ##"
  13. echo "                         #"
  14. echo "             #################"
  15. echo "          ####################"
  16. echo "          ####################"
  17. echo "          ##             #"
  18. echo "          ##"
  19. echo "            #"
  20. echo "          ####      ## "
  21. echo "          ####    ###### "
  22. echo "          ##     ######## "
  23. echo "          #     ####     #"
  24. echo "          #     ####     #"
  25. echo "          #     ####    ##"
  26. echo "          #    ####    ## "
  27. echo "           ########   ####"
  28. echo "            #####"
  29. echo " v1ral_ITS"
  30. echo " https://pastebin.com/u/v1ral_ITS"
  31. echo " ImPerialTeKSolutions@outlook.com"
  32. sleep 2
  33.  
  34. VPNdir="/home/`whoami`/vpnbook"
  35.  
  36. # MAKE SURE CONFIG. FILES AND .ovpn CONFIG FILES ARE NOT NEEDED TO DOWNLOAD AND CREATE
  37. read answer_1 < <( zenity --title "www.openvpn.com/freevpn Config Files" --width=560 --text "Do we need to download config files, and create script directory \nWorking Directory /home/"$(echo $USER)"/vpnbook \nAnswer 'yes' To auto create directory and download config files. \nAnswer no to continue" --forms --add-entry "Answer:" )
  38. if [[ $answer_1 == yes ]]; then
  39.     mkdir $HOME/vpnbook
  40.     cd $HOME/vpnbook
  41.     curl -LO  https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-US1.zip
  42.     curl -LO  https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-Euro1.zip
  43.     curl -LO  https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-CA1.zip
  44.     curl -LO  https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-FR1.zip
  45.     unzip $HOME/vpnbook/VPNBook.com-OpenVPN-US1.zip
  46.     unzip $HOME/vpnbook/VPNBook.com-OpenVPN-Euro1.zip
  47.     unzip $HOME/vpnbook/VPNBook.com-OpenVPN-CA1.zip
  48.     unzip $HOME/vpnbook/VPNBook.com-OpenVPN-FR1.zip
  49. fi
  50.  
  51. notify-send "Get password from this site" && firefox https://vpnbook.com/freevpn
  52. read CONFIG < <( \ls $HOME/vpnbook | zenity --title "Configuration Files: $VPNdir" --list --column "ImPerial TeK. Solutions {v1ral_ITS}" --width=1000 --height=200 )
  53.  
  54. function menu {
  55.  
  56. # Input Dialog
  57. input=$( zenity --title "Easy ITS_ openvpn GUI" --width=560 --text "Enter vpnbook As Username And Password From Site" --forms --add-entry "Username" --add-entry "Password" )
  58.  
  59. ret=$?
  60.  
  61. # Is clicked exit, then exit.
  62. [[ $ret -eq 1 ]] && exit 0
  63.  
  64. # Error handling source. If nothing was entered return to menu.
  65. if [ -z "$(echo $input | awk 'BEGIN {FS="|" } { print $1 }')" ]; then
  66.     zenity --width=560 --warning="No Username Was Specified" --text="<b> No USERNAME input specified.</b>\n\n Please specify Username \n\n Back to menu ..." --ok-label="Back to menu"
  67.     menu
  68. fi
  69.  
  70. # Error handling target. If nothing was entered return to menu
  71. if [ -z "$(echo $input | awk 'BEGIN {FS="|" } { print $2 }')" ]; then
  72.     zenity --width=560 --warning="No Password Was Specified" --text="<b> No PASSWORD input specified.</b>\n\n Please specify PASSWORD \n\n Back to menu ..." --ok-label="Back to menu"
  73.     menu
  74. fi
  75.  
  76. }
  77. menu
  78. Username=$(echo $input | awk 'BEGIN {FS="|" } { print $1 }')
  79. Password=$(echo $input | awk 'BEGIN {FS="|" } { print $2 }')
  80.  
  81. export Username
  82. export Password
  83.  
  84. # Pre warning dialog.
  85. zenity --info --width=560 --height=40 --title="Starting File System Check.. " --timeout 2 --text="<b> Operation is starting ...  Please wait ..... </b>"
  86.  
  87. # Start and show a pulsating progressbar.
  88. echo -e "$Username\n$Password" > /home/$(echo `whoami`)/vpnbook/vpnbook.auth
  89. sudo xterm -title "ITS_ VPN" -e sudo openvpn --config /home/$(echo `whoami`)/vpnbook/$CONFIG --auth-user-pass /home/$(echo `whoami`)/vpnbook/vpnbook.auth
  90. # Success dialog.
  91. zenity --info --width=560 --title="End .. " --timeout 20 --text="<b>Success:</b><span color=\"blue\">  Operation has been successfully finalized.</span> \n\n<b>ITS_ VPN DISCONNECTED</b>"
  92. exit 0
  93. # End here.
  94. echo ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement