Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Austin Korpi

By: a guest on Sep 14th, 2009  |  syntax: None  |  size: 0.69 KB  |  views: 55  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. [ -f /etc/conf.d/ddclient.conf ] && . /etc/conf.d/ddclient
  4.  
  5. . /etc/rc.conf
  6. . /etc/rc.d/functions
  7.  
  8. PID=`pidof -o %PPID /usr/sbin/ddclient`
  9. case "$1" in
  10.   start)
  11.     stat_busy "Starting ddclient"
  12.     [ -z "$PID" ] && /usr/sbin/ddclient ${EXTRA_ARGS}
  13.     if [ $? -gt 0 ]; then
  14.       stat_fail
  15.     else
  16.       add_daemon ddclient
  17.       stat_done
  18.     fi
  19.     ;;
  20.   stop)
  21.     stat_busy "Stopping ddclient"
  22.     [ -n "$PID" ] && kill -15 $PID >/dev/null
  23.     if [ $? -gt 0 ]; then
  24.       stat_fail
  25.     else
  26.       rm_daemon ddclient
  27.       stat_done
  28.     fi
  29.     ;;
  30.   restart)
  31.     $0 stop
  32.     sleep 1
  33.     $0 start
  34.     ;;
  35.   *)
  36.     echo "usage: $0 {start|stop|restart}"
  37. esac