summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/community/transmission-cli/run
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-01-31 04:41:55 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-01-31 04:41:55 (GMT)
commit5c2677cd9496cf474c8536e2eb3c0173ec1b8acb (patch)
treee6ce88d406c19a7e8bafe223eae31d1b84848a71 /abs/extra-testing/community/transmission-cli/run
parentd1886ec6d4523a6d0714f8ed9f12d754b59857c1 (diff)
downloadlinhes_pkgbuild-5c2677cd9496cf474c8536e2eb3c0173ec1b8acb.zip
linhes_pkgbuild-5c2677cd9496cf474c8536e2eb3c0173ec1b8acb.tar.gz
linhes_pkgbuild-5c2677cd9496cf474c8536e2eb3c0173ec1b8acb.tar.bz2
transmission-cli: updated pkgbuild with attached from FS#604
closes FS#604
Diffstat (limited to 'abs/extra-testing/community/transmission-cli/run')
-rwxr-xr-xabs/extra-testing/community/transmission-cli/run35
1 files changed, 35 insertions, 0 deletions
diff --git a/abs/extra-testing/community/transmission-cli/run b/abs/extra-testing/community/transmission-cli/run
new file mode 100755
index 0000000..6bcab36
--- /dev/null
+++ b/abs/extra-testing/community/transmission-cli/run
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/transmissiond
+
+CONFIGDIR=/home/$TRANS_USER/.config/transmission-daemon
+PID=`pidof -o %PPID /usr/bin/transmission-daemon`
+# Update the block lists - try to keep the bad guys out.
+ cd ${CONFIGDIR}/blocklists
+ if [ $? -eq 0 ]; then
+ find . -mtime +4 -type f -name level1 -exec rm {} \;
+ if [ ! -f ${CONFIGDIR}/blocklists/level1 ]; then
+ # update blocklist
+ # echo "updating blocklist, ~4MB"
+ wget -q -O level1.gz http://download.m0k.org/transmission/files/level1.gz
+ if [ -f level1.gz ]; then
+ gunzip level1.gz
+ if [ $? -eq 0 ]; then
+ chmod go+r level1
+ else
+ rm -f level1*
+ fi
+ fi
+ fi
+ cd - 2>&1 >/dev/null
+ fi
+ stat_runit "Starting Transmission Daemon"
+ [ -z "$PID" ] && su -l -c "/usr/bin/nice -n 19 /usr/bin/transmission-daemon $TRANS_OPTS" $TRANS_USER 2>/dev/null
+ if [ $? -ne 0 ]; then
+ stat_fail
+ else
+ add_daemon transmissiond
+ stat_done
+ fi