Advertisement
mmornati

Untitled

Oct 11th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # hdactl This shell script takes care of starting and stopping hdactl.
  4. #
  5. # chkconfig: 345 65 35
  6. # description: hdactl provides support for dynamically updating DHCP/DNS services
  7. # processname: hdactl
  8. # config: /etc/sysconfig/hdactl
  9.  
  10. # Source function library.
  11. . /etc/rc.d/init.d/functions
  12.  
  13. # Source networking configuration.
  14. . /etc/sysconfig/network
  15.  
  16. # Check that networking is up.
  17. [ "$NETWORKING" = "no" ] && exit 0
  18.  
  19. . /etc/sysconfig/hdactl
  20.  
  21. exec="/usr/bin/hdactl"
  22. prog=$(basename $exec)
  23. lockfile=/var/lock/subsys/$prog
  24.  
  25. start() {
  26. if [ -f $lockfile ]; then
  27. return 0
  28. fi
  29. if [ ! -e /var/cache/hdactl.cache ]; then
  30. logger "hdactl: this hda has not been completely installed; exiting"
  31. return 0
  32. fi
  33. echo -n $"Starting $prog: "
  34. daemon $exec $HDACTL_OPTIONS
  35. retval=$?
  36. echo
  37. [ $retval -eq 0 ] && touch $lockfile
  38.  
  39. stop() {
  40. echo -n $"Stopping $prog: "
  41. killproc $prog
  42. retval=$?
  43. echo
  44. [ $retval -eq 0 ] && rm -f $lockfile
  45. return $retval
  46. }
  47.  
  48. restart() {
  49. stop
  50. start
  51. }
  52.  
  53. reload() {
  54. restart
  55. }
  56.  
  57. force_reload() {
  58. restart
  59. }
  60.  
  61. fdrstatus() {
  62. status $prog
  63. }
  64.  
  65. # See how we were called.
  66. case "$1" in
  67. start|stop|restart|reload)
  68. $1
  69. ;;
  70. force-reload)
  71. force_reload
  72. ;;
  73. status)
  74. fdrstatus
  75. ;;
  76.  
  77. [...]
  78.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement