start transmission with SLICE_GROUP dirs
[cloudstore.git] / init.d / s1-seeder
index aa99b26..7f55f09 100755 (executable)
@@ -1,26 +1,33 @@
 #!/bin/sh
 
-eval export `grep s1 /var/lib/extrausers/group | cut -d: -f4`
+. /srv/cloudstore/init.d/_start_stop
+
+eval export `grep $SLICE_GROUP /var/lib/extrausers/group | cut -d: -f4`
+dir=`grep $SLICE_GROUP /var/lib/extrausers/group | cut -d: -f2`
 
 NAME=`basename $0`
 
 if [ "$1" = "start" ] ; then
 
+test -d $dir/torrent/incomplete || mkdir -p $dir/torrent/incomplete
+test -d $dir/torrent/download   || mkdir -p $dir/torrent/download
+
 /usr/bin/transmission-daemon \
 --allowed 127.0.0.1,10.13.37.* \
 --no-watch-dir \
---incomplete-dir /rsync1/s1/torrent/incomplete/ \
---download-dir /rsync1/s1/torrent/download/ \
---logfile /tmp/$NAME.log \
+--incomplete-dir $dir/torrent/incomplete/ \
+--download-dir $dir/torrent/download/ \
+--logfile $dir/log/$NAME.log \
 --dht \
 --lpd \
---utp \
 --peerport 6503 \
 --encryption-preferred \
 --bind-address-ipv4 $seed_ip \
 --no-portmap \
 --pid-file /tmp/$NAME.pid \
---config-dir /rsync1/s1/torrent/
+--config-dir $dir/torrent/
+
+#--utp \
 
 elif [ "$1" = "stop" ] ; then
        kill `cat /tmp/$NAME.pid`