Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1690043
  • 博文数量: 782
  • 博客积分: 2455
  • 博客等级: 大尉
  • 技术积分: 4140
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-06 21:37
个人简介

Linux ,c/c++, web,前端,php,js

文章分类

全部博文(782)

文章存档

2015年(8)

2014年(28)

2013年(110)

2012年(307)

2011年(329)

分类:

2011-12-22 09:59:50

原文地址:简单的shell启动脚本 作者:464735790

  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
阅读(345) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~