Guest User

Untitled

a guest
Jul 17th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #!/bin/sh
  2. # chkconfig: 2345 99 01
  3. # description: SoftEther VPN Server
  4. DAEMON=/usr/local/vpnserver/vpnserver
  5. LOCK=/var/lock/subsys/vpnserver
  6. TAP_ADDR=10.100.10.1
  7. TAP_NETWORK=10.100.10.0/24
  8. SERVER_IP=[SERVER_IP]
  9. test -x $DAEMON || exit 0
  10. case "$1" in
  11. start)
  12. $DAEMON start
  13. touch $LOCK
  14. sleep 1
  15. /sbin/ifconfig tap_soft $TAP_ADDR
  16. iptables -t nat -F
  17. iptables -t nat -A POSTROUTING -s ${TAP_NETWORK} -j SNAT --to-source ${SERVER_IP}
  18. ;;
  19. stop)
  20. $DAEMON stop
  21. rm $LOCK
  22. ;;
  23. restart)
  24. $DAEMON stop
  25. sleep 3
  26. $DAEMON start
  27. sleep 1
  28. /sbin/ifconfig tap_soft $TAP_ADDR
  29. iptables -t nat -F
  30. iptables -t nat -A POSTROUTING -s ${TAP_NETWORK} -j SNAT --to-source ${SERVER_IP}
  31. ;;
  32. *)
  33. echo "Usage: $0 {start|stop|restart}"
  34. exit 1
  35. esac
  36. exit 0
Add Comment
Please, Sign In to add comment