[arch-commits] Commit in deluge/trunk (deluged)

Hugo Doria hugo at archlinux.org
Sat Mar 28 15:11:12 UTC 2009


    Date: Saturday, March 28, 2009 @ 11:11:12
  Author: hugo
Revision: 31913

deluged file added

Added:
  deluge/trunk/deluged

---------+
 deluged |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

Added: deluged
===================================================================
--- deluged	                        (rev 0)
+++ deluged	2009-03-28 15:11:12 UTC (rev 31913)
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[[ -f /var/run/deluged.pid ]] && PID=`cat /var/run/deluged.pid`
+
+case "$1" in
+  start)
+    stat_busy "Starting Deluge Daemon"
+    [[ -z $PID ]] && /usr/bin/deluged 2>&1
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      echo $(pgrep deluged) > /var/run/deluged.pid
+      add_daemon deluged
+      stat_done
+    fi
+    ;;
+  stop)
+    stat_busy "Stopping Deluge Daemon"
+    [[ ! -z $PID ]] && kill $PID &> /dev/null
+    if [ $? -gt 0 ]; then
+      stat_fail
+    else
+      rm /var/run/deluged.pid
+      rm_daemon deluged
+      stat_done
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  *)
+    echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
+
+
+




More information about the arch-commits mailing list