pptpd.init 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. #
  3. # Startup script for pptpd
  4. #
  5. # chkconfig: - 85 15
  6. # description: PPTP server
  7. # processname: pptpd
  8. # config: /etc/pptpd.conf
  9. # Source function library.
  10. . /etc/rc.d/init.d/functions
  11. # See how we were called.
  12. case "$1" in
  13. start)
  14. echo -n "Starting pptpd: "
  15. if [ -f /var/lock/subsys/pptpd ] ; then
  16. echo
  17. exit 1
  18. fi
  19. daemon /usr/sbin/pptpd
  20. echo
  21. touch /var/lock/subsys/pptpd
  22. ;;
  23. stop)
  24. echo -n "Shutting down pptpd: "
  25. killproc pptpd
  26. echo
  27. rm -f /var/lock/subsys/pptpd
  28. ;;
  29. status)
  30. status pptpd
  31. ;;
  32. condrestart)
  33. if [ -f /var/lock/subsys/pptpd ]; then
  34. $0 stop
  35. $0 start
  36. fi
  37. ;;
  38. reload|restart)
  39. $0 stop
  40. $0 start
  41. echo "Warning: a pptpd restart does not terminate existing "
  42. echo "connections, so new connections may be assigned the same IP "
  43. echo "address and cause unexpected results. Use restart-kill to "
  44. echo "destroy existing connections during a restart."
  45. ;;
  46. restart-kill)
  47. $0 stop
  48. ps -ef | grep pptpd | grep -v grep | grep -v rc.d | awk '{print $2}' | uniq | xargs kill 1> /dev/null 2>&1
  49. $0 start
  50. ;;
  51. *)
  52. echo "Usage: $0 {start|stop|restart|restart-kill|status}"
  53. exit 1
  54. esac
  55. exit 0