From: <sis...@sy...> - 2007-03-20 18:34:41
|
Author: arighi Date: 2007-03-20 13:34:28 -0500 (Tue, 20 Mar 2007) New Revision: 3991 Modified: trunk/etc/init.d/systemimager-server-bittorrent Log: allow to download torrent files directly via web Modified: trunk/etc/init.d/systemimager-server-bittorrent =================================================================== --- trunk/etc/init.d/systemimager-server-bittorrent 2007-03-20 18:25:19 UTC (rev 3990) +++ trunk/etc/init.d/systemimager-server-bittorrent 2007-03-20 18:34:28 UTC (rev 3991) @@ -61,7 +61,14 @@ fi # Check tracker to see if it supports --twisted flag ($BT_TRACKER_BIN 2>&1 | grep -q twisted) && BT_TWISTED="--twisted 0" - $BT_TRACKER_BIN --port $BT_TRACKER_PORT --dfile $BT_TRACKER_STATE --logfile $BT_TRACKER_LOG $BT_TWISTED 0</dev/null 1>/dev/null 2>&1 & + # Allow to download .torrent files directly via web. + torrent_dir=`cat /etc/systemimager/systemimager.conf | sed -ne 's/\s*AUTOINSTALL_TORRENT_DIR\s*=\s*\(.*\)\s*/\1/p'` + if [ ! -d $torrent_dir ]; then + echo failed. + echo AUTOINSTALL_TORRENT_DIR is not defined in /etc/systemimager/systemimager.conf + exit 1 + fi + $BT_TRACKER_BIN --allowed_dir $torrent_dir --port $BT_TRACKER_PORT --dfile $BT_TRACKER_STATE --logfile $BT_TRACKER_LOG $BT_TWISTED 0</dev/null 1>/dev/null 2>&1 & if [ $? -ne 0 ]; then echo failed. exit 1 |