Chinaunix首页 | 论坛 | 博客
  • 博客访问: 82681
  • 博文数量: 15
  • 博客积分: 315
  • 博客等级: 二等列兵
  • 技术积分: 180
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-28 08:37
文章分类
文章存档

2012年(2)

2011年(13)

我的朋友

分类: LINUX

2011-12-13 17:05:56

  1. #!/bin/sh
  2. #
  3. # Startup script for pptpd
  4. #
  5. # chkconfig: - 85 15       加入开机启动,chkconfig
  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/local/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
阅读(2991) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~