Guest User

Untitled

a guest
Oct 19th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #!/bin/bash
  2. function routeadd {
  3. route add -host xxx.xxx.xxx.xxx dev ppp0
  4. route add -net xxx.xxx.xxx.xxx/xx dev ppp0
  5. }
  6. function makepptp {
  7. echo pty "pptp xxx.xxx.xxx.xxx --nolaunchpppd" >> /etc/ppp/peers/vpn;
  8. echo remotename PPTP >> /etc/ppp/peers/vpn;
  9. echo require-mppe-128 >> /etc/ppp/peers/vpn;
  10. echo file /etc/ppp/options.pptp >> /etc/ppp/peers/vpn;
  11. echo ipparam vpn >> /etc/ppp/peers/vpn;
  12. pppd call vpn &
  13. }
  14. if [ -a /etc/ppp/chap-secrets ];
  15. then
  16. rm /etc/ppp/chap-secrets
  17. echo $1 PPTP $2 '*' >> /etc/ppp/chap-secrets;
  18. else
  19. echo $1 PPTP $2 '*' >> /etc/ppp/chap-secrets;
  20. fi
  21.  
  22. if [ -e /etc/ppp/peers/vpn ];
  23. then
  24. rm /etc/ppp/peers/vpn;
  25. echo name $1 >> /etc/ppp/peers/vpn;
  26. makepptp;
  27. sleep 8;
  28. routeadd;
  29. else
  30. echo name $1 >> /etc/ppp/peers/vpn;
  31. makepptp;
  32. sleep 8;
  33. routeadd;
  34. fi
  35.  
  36. sudo /path_to_script/vpn username password
  37.  
  38. function routeadd {
  39. route add -host xxx.xxx.xxx.xxx dev ppp0
  40. route add -net xxx.xxx.xxx.xxx/xx dev ppp0
  41. }
  42.  
  43. function routeadd {
  44. route add -host ip_address_for_vnc dev eth0
  45. route add default dev ppp0
  46. }
Add Comment
Please, Sign In to add comment