Advertisement
noes1s

Linux trick: VPN Connect

May 13th, 2011
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. #!/bin/bash
  2. #  ,___
  3. #  ¡  _`
  4. #  ª_/()     VPN Connect
  5. #  |\` `,    http://pastebin.com/u/noes1s
  6. # _·'   l
  7. #Root>Dependencies>Internet>Install>Config>Start/Stop
  8. ((UID)) && echo -e "\n\e[1;31m"' (!) '"\e[msudo bash $0\n" && exit 1
  9. for d in vpnc; {
  10.     which $d || dpkg-query -l $d|grep -w 'ii' || {
  11.         ! ping -c2 tiny.cc && echo -e "\n\e[1;31m"' (!) '"Internet required\e[m\n" && exit 1
  12.         pkill synaptic && apt-get install -y $d ;} ;} >/dev/null
  13. echo 'IPsec ID hss
  14. IPsec secret hss
  15. IPsec gateway 68.68.107.101
  16. Xauth password ****
  17. Xauth username ****' >> /tmp/vpn.conf
  18. ! ps -A |grep vpnc-connect &&
  19.     vpnc-connect /tmp/vpn.conf &&
  20.         echo 'message:VPN [ ENABLED ]' | zenity --notification --listen ||
  21.     pkill -9 vpnc-connect &&
  22.         echo 'message:VPN [ DISABLED ]' | zenity --notification --listen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement