Advertisement
Guest User

modified /etc/rc.d/sickbeard

a guest
Oct 31st, 2011
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  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 "Sick Beard is already running as a daemon!"
  13.             stat_fail
  14.     else
  15.             su - ${SICKBEARD_USER} -c "python2 /opt/sickbeard/SickBeard.py --port ${SICKBEARD_PORT}  &> /dev/null &" -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 (May take up to a minute to shutdown after this command)"
  26.  
  27.     curl -f "http://localhost:${SICKBEARD_PORT}/home/shutdown/" &> /dev/null
  28.  
  29.     if [ $? -gt 0 ]; then
  30.             stat_fail
  31.     else
  32.             rm_daemon sickbeard
  33.             stat_done
  34.     fi
  35.     ;;
  36.   restart)
  37.     $0 stop
  38.     sleep 1
  39.     $0 start
  40.     ;;
  41.   *)
  42.     echo "usage: $0 {start|stop|restart}"
  43. esac
  44. exit 0
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement