Code sources - deluge.script source code

From WikiDLXTV
Revision as of 14:27, 26 March 2010 by Skreeves (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#!/bin/sh

DELUGECONFIG="$2"

case "$1" in
start)
       	online.delayer 60 # pause until online
	add.webplugin deluge /etc/deluge/deluge
	deluged -c $DELUGECONFIG
	if [ "`grep -i \^DELUGEWEBUI=\'OFF\' /conf/config`" == "" ] ; then 
   		[ -w /var/www -a ! -d /var/www/deluge ] && ln -s  $DELUGECONFIG /var/www/deluge		
		sleep 3 && deluge -c $DELUGECONFIG -u web &
	fi
   ;;
stop)
   [ "`pidof deluged`" != "" ] && killall deluged && sleep 5
   [ "`pidof deluge`" != "" ] && killall deluge && sleep 5
   ;;
*)
   echo "Usage: $0 (start|stop)"
   ;;
esac