softether-vpnserver.init 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #! /bin/sh
  2. #
  3. # Author: Dmitry Orlov <[email protected]>
  4. # From Debian skeleton (Tom deLombarde)
  5. #
  6. set -e
  7. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/qmsys/bin
  8. DAEMON=/usr/bin/vpnserver
  9. NAME=vpnserver
  10. DESC="SoftEtherVPN Server"
  11. PIDFILE=/var/run/$NAME.pid
  12. SCRIPTNAME=/etc/init.d/$NAME
  13. # Gracefully exit if the package has been removed.
  14. test -x $DAEMON || exit 0
  15. # Read config file if it is present.
  16. #if [ -r /etc/default/$NAME ]
  17. #then
  18. # . /etc/default/$NAME
  19. #fi
  20. case "$1" in
  21. start)
  22. echo -n "Starting $DESC: $NAME"
  23. $DAEMON start
  24. echo "."
  25. ;;
  26. stop)
  27. echo -n "Stopping $DESC: $NAME"
  28. $DAEMON stop
  29. echo "."
  30. ;;
  31. #reload)
  32. #
  33. # If the daemon can reload its config files on the fly
  34. # for example by sending it SIGHUP, do it here.
  35. #
  36. # If the daemon responds to changes in its config file
  37. # directly anyway, make this a do-nothing entry.
  38. #
  39. # echo -n "Reloading $DESC configuration..."
  40. # start-stop-daemon --stop --signal 1 --quiet --pidfile \
  41. # $PIDFILE --exec $DAEMON
  42. # echo "done."
  43. #;;
  44. restart|force-reload)
  45. #
  46. # If the "reload" option is implemented, move the "force-reload"
  47. # option to the "reload" entry above. If not, "force-reload" is
  48. # just the same as "restart".
  49. #
  50. echo -n "Restarting $DESC: $NAME"
  51. $DAEMON stop
  52. sleep 1
  53. $DAEMON start
  54. echo "."
  55. ;;
  56. *)
  57. # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
  58. echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  59. exit 1
  60. ;;
  61. esac
  62. exit 0