summaryrefslogtreecommitdiffstats
path: root/abs/extra/transmission/transmissiond
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-12-02 17:23:35 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-12-02 17:23:35 (GMT)
commit6d9dd628c02db0885228005684bd81c1849dd0dd (patch)
tree01e24bbd60a60dca886ec9350fea85ebfe1134f8 /abs/extra/transmission/transmissiond
parent216d08c3941deed5ac0c9325d6bf33dcdfa1f5ac (diff)
downloadlinhes_pkgbuild-6d9dd628c02db0885228005684bd81c1849dd0dd.zip
linhes_pkgbuild-6d9dd628c02db0885228005684bd81c1849dd0dd.tar.gz
linhes_pkgbuild-6d9dd628c02db0885228005684bd81c1849dd0dd.tar.bz2
transmission: 2.7.3
Diffstat (limited to 'abs/extra/transmission/transmissiond')
-rw-r--r--abs/extra/transmission/transmissiond46
1 files changed, 46 insertions, 0 deletions
diff --git a/abs/extra/transmission/transmissiond b/abs/extra/transmission/transmissiond
new file mode 100644
index 0000000..ea3d770
--- /dev/null
+++ b/abs/extra/transmission/transmissiond
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/transmissiond
+
+PID=`pidof -o %PPID /usr/bin/transmission-daemon`
+case "$1" in
+ start)
+ stat_busy "Starting Transmission Daemon"
+ [ -z "$PID" ] && su -l -s /bin/sh -c "/usr/bin/transmission-daemon $TRANS_ARGS" "${TRANS_USER:-transmission}"
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon transmissiond
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Transmission Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon transmissiond
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ while [ ! -z "$PID" -a -d "/proc/$PID" ]; do sleep 1; done
+ $0 start
+ ;;
+ reload)
+ stat_busy "Reloading config"
+ [ ! -z "$PID" ] && kill -HUP $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart|reload}"
+esac
+exit 0