Advertisement
deseven

/etc/init.d/deluged

Nov 21st, 2011
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.86 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Startup script for deluged
  4. #
  5. # chkconfig: - 86 14
  6. # description: deluge daemon
  7. # processname: deluged
  8. # pidfile: /var/run/deluged.pid
  9. # config:
  10.  
  11. # Source function library.
  12. . /etc/init.d/functions
  13.  
  14. # Get network config
  15. . /etc/sysconfig/network
  16.  
  17. [ "${NETWORKING}" = "no" ] && exit 0
  18.  
  19. prog=deluged
  20. params="-q"
  21. lockfile=/var/lock/subsys/deluged
  22.  
  23. start() {
  24.     echo -n $"Starting deluged: "
  25.     daemon --user deseven "$prog $params"
  26.     RETVAL=$?
  27.     echo
  28.     [ $RETVAL -eq 0 ] && touch $lockfile
  29.     return $RETVAL
  30. }
  31.  
  32. stop() {
  33.     echo -n $"Stopping deluged: "
  34.     killproc $prog
  35.     RETVAL=$?
  36.     echo
  37.     [ $RETVAL -eq 0 ] && rm -f $lockfile
  38.     return $RETVAL
  39. }
  40.  
  41. case "$1" in
  42.     start)
  43.         start
  44.         ;;
  45.     stop)
  46.         stop
  47.         ;;
  48.     status)
  49.         status $prog
  50.         ;;
  51.     restart)
  52.         stop
  53.         start
  54.         ;;
  55.     *)
  56.         echo $"Usage: $prog {start|stop|status|restart}"
  57.         exit 1
  58. esac
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement