Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)

/etc/rc.d/sickbeard

By: AustinMatherne on May 13th, 2012  |  syntax: Bash  |  size: 0.99 KB  |  hits: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. . /etc/rc.conf
  4. . /etc/rc.d/functions
  5. . /etc/conf.d/sickbeard
  6.  
  7. case "$1" in
  8.   start)
  9.     stat_busy "Starting Sick-Beard"
  10.  
  11.     if [ -f /var/run/daemons/sickbeard ]; then
  12.       echo -n "Sickbeard is already running as a daemon! If you are certain it is not running, remove /var/run/daemons/sickbeard."
  13.       stat_fail
  14.     else
  15.       su - $SB_USER -c "$SB_PYTHON $SB_BIN -q -d --data $SB_DATA --config $SB_CONF --port $SB_PORT" -s /bin/sh
  16.       if [ $? -gt 0 ]; then
  17.         stat_fail
  18.       else
  19.         add_daemon sickbeard
  20.         stat_done
  21.       fi
  22.     fi
  23.     ;;
  24.   stop)
  25.     stat_busy "Stopping Sick-Beard"
  26.  
  27.  
  28.     wget -q --delete-after $SB_PROTOCOL://${SB_USPW}localhost:$SB_PORT$SB_WEBROOT/home/shutdown/ &> /dev/null
  29.  
  30.     if [ "${?}" -gt 0 ]; then
  31.       stat_fail
  32.     else
  33.       rm_daemon sickbeard
  34.       stat_done
  35.     fi
  36.     ;;
  37.   restart)
  38.     "${0}" stop
  39.     sleep 1
  40.     "${0}" start
  41.     ;;
  42.   *)
  43.     echo "usage: ${0} {start|stop|restart}"
  44. esac
  45. exit 0