...
Code Block | ||
---|---|---|
| ||
#!/usr/bin/env bash
L_KEY=792bd8f0a4709e82ee3ac93f9f
L_TORRENTS=/var/run/lobber
L_USER=debian-transmission
L_GROUP_PERM=debian-transmission
L_PIDDIR=/var/run/lobber-storagenode
L_PIDFILE=lobber-storagenode.pid
L_LOG=--syslog
#L_URLS="https://beta.lobber.se/torrent/all.json"
L_HOST="dev.lobber.se"
# SEEDER="transmission-remote -n transmission:transmission -a"
# --torrent-done-script FILE
L_ARGS="--standardNotifications --trackerProxyTrackerUrl=http://dev.lobber.se/trac
ker/announce --trackerProxyListenOn=127.0.0.1:8080"
if [ -f /etc/config.d/lobber ]; then
. /etc/config.d/lobber
fi
if [ -f /etc/defaults/lobber ]; then
. /etc/defaults/lobber
fi
L_OPTS="$L_LOG --pidfile $L_PIDDIR/$L_PIDFILE lobberstoragenode $L_ARGS"
if [ "x$L_KEY" != "x" ]; then
L_OPTS="${L_OPTS} -k $L_KEY"
fi
if [ "x$L_HOST" != "x" ]; then
L_OPTS="${L_OPTS} -h $L_HOST"
fi
if [ "x$L_TORRENTS" != "x" ]; then
L_OPTS="${L_OPTS} -d $L_TORRENTS"
fi
case "$1" in
start)
transmission-remote -n transmission:transmission -GSR #seed forever
transmission-remote -n transmission:transmission -t all -s #start all (just in case)
[ -d $L_TORRENTS ] || mkdir -p $L_TORRENTS
chown $L_USER:$L_GROUP_PERM $L_TORRENTS
chmod 770 $L_TORRENTS
[ -d $L_PIDDIR ] || mkdir $L_PIDDIR
chown $L_USER:$L_GROUP_PERM $L_PIDDIR
chmod 770 $L_PIDDIR
cd $L_PIDDIR
sudo -u $L_USER twistd $L_OPTS -r 2 -D /var/www/dropbox $L_URLS
;;
stop)
kill `cat $L_PIDDIR/$L_PIDFILE`
;;
*)
echo "Usage: /etc/init.d/lobber {start|stop}"
exit 1
;;
esac
| ||
Unrevised old documentation
...