Advertisement
retnet

init script vpnserver dengan VirtualNAT function

May 27th, 2014
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. nano /etc/init.d/vpnserver
  2. ## isi dengan script dibawah ini
  3. **************
  4. #!/bin/sh
  5. ### BEGIN INIT INFO
  6. # Provides:          vpnserver
  7. # Required-Start:    $remote_fs $syslog
  8. # Required-Stop:     $remote_fs $syslog
  9. # Default-Start:     2 3 4 5
  10. # Default-Stop:      0 1 6
  11. # Short-Description: Start daemon at boot time
  12. # Description:       Enable Softether by daemon.
  13. ### END INIT INFO
  14. DAEMON=/usr/local/vpnserver/vpnserver
  15. LOCK=/var/lock/subsys/vpnserver
  16. test -x $DAEMON || exit 0
  17. case "$1" in
  18. start)
  19. $DAEMON start
  20. touch $LOCK
  21. ;;
  22. stop)
  23. $DAEMON stop
  24. rm $LOCK
  25. ;;
  26. restart)
  27. $DAEMON stop
  28. sleep 3
  29. $DAEMON start
  30. ;;
  31. *)
  32. echo "Usage: $0 {start|stop|restart}"
  33. exit 1
  34. esac
  35. exit 0
  36. **************
  37.  
  38. chmod a+x /etc/init.d/vpnserver
  39. mkdir -p /var/lock/subsys/vpnserver
  40. update-rc.d vpnserver defaults
  41. /etc/init.d/vpnserver start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement