kena tengok nak pakai apa? deluge? transmission? torrentflux? dll
ini step untuk debian 6 / ubuntu 14 ke bawah ..... masa ni aku buat menjadi.
Code:
sudo adduser --disabled-password --system --home /var/lib/deluge --gecos "[U][I][B]*USER*[/B][/I][/U] SeedBox" --group deluge
sudo touch /var/log/deluged.log
sudo touch /var/log/deluge-web.log
sudo chown deluge:deluge /var/log/deluge*
sudo apt-get update
sudo apt-get install deluged deluge-webui
sudo nano /etc/init.d/deluge
######COPY THIS INIT SCRIPTS######
## BEGIN INIT INFO
# Provides: deluged
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start deluged at boot time
# Description: Start DelugeD and Deluge-Web.
### END INIT INFO
#Author QuidsUp
#Last Modified 26 Jan 2013
#Required -- To be changed!
USER=deluge #Set Username here.
PORT=8008 #Set port number for web interface (default 8112)
PIDFileDeluge=/var/run/deluged.pid
PIDFileWeb=/var/run/deluge-web.pid
case "$1" in
start)
echo "Starting Deluge"
start-stop-daemon --start --chuid $USER --name deluged --pidfile $PIDFileDeluge \
--background --make-pidfile --exec /usr/bin/deluged -- --do-not-daemonize
start-stop-daemon --start --chuid $USER --name deluge-web --pidfile $PIDFileWeb \
--background --make-pidfile --exec /usr/bin/deluge-web -- --port $PORT
;;
stop)
echo "Stopping Deluge"
start-stop-daemon --stop --chuid $USER --name deluged --pidfile $PIDFileDeluge
start-stop-daemon --stop --chuid $USER --name deluge-web --pidfile $PIDFileWeb
;;
restart|force-reload)
echo "Stopping Deluge for Restart"
start-stop-daemon --stop --chuid $USER --name deluged --pidfile $PIDFileDeluge
start-stop-daemon --stop --chuid $USER --name deluge-web --pidfile $PIDFileWeb
sleep 5s
echo "Restarting Deluge"
start-stop-daemon --start --chuid $USER --name deluged --pidfile $PIDFileDeluge \
--background --make-pidfile --exec /usr/bin/deluged -- --do-not-daemonize
start-stop-daemon --start --chuid $USER --name deluge-web --pidfile $PIDFileWeb \
--background --make-pidfile --exec /usr/bin/deluge-web -- --port $PORT
;;
status)
echo "Checking Status of Deluge"
if (test -f $PIDFileDeluge); then
PIDVal=$(head -1 $PIDFileDeluge)
if [ -e /proc/$PIDVal ]; then
echo -n "DelugeD Running on Process ID: "
echo $PIDVal
echo
ps -H $PIDVal
else
echo "DelugeD Not Running but PID File Exists"
exit 1
fi
else
echo "No PID File found for DelugeD"
fi
;;
*)
echo "Usage: deluge {start|stop|restart|force-reload|status**" >&2
exit 1
;;
esac
exit 0
######COPY THIS INIT SCRIPTS######
sudo chmod a+x /etc/init.d/deluge
sudo update-rc.d deluge defaults
service deluge start