]>
Commit | Line | Data |
---|---|---|
06209efc MT |
1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/ipfireseeder | |
4 | # | |
5 | # Description : This is a script that starts the torrent-seeder on your | |
6 | # local IPFire. | |
7 | # | |
8 | # Authors : Michael Tremer (mitch@ipfire.org) | |
9 | # | |
10 | # Version : 01.00 | |
11 | # | |
12 | # Notes : | |
13 | # | |
14 | ######################################################################## | |
15 | ||
16 | . /etc/sysconfig/rc | |
17 | . ${rc_functions} | |
18 | ||
19 | case "${1}" in | |
20 | start) | |
21 | boot_mesg "Starting IPFire Seeder..." | |
22 | cd /var/log/seeder | |
65798afe MT |
23 | loadproc screen -dmS seeder /usr/bin/rtorrent -o port_range=35700-35705 \ |
24 | /var/ipfire/seeder/*.torrent | |
25 | if ! grep -q "35700:35705" /var/ipfire/xtaccess/config ; then | |
26 | echo "tcp,0.0.0.0/0,35700:35705,on,0.0.0.0,IPFireSeeder" >> /var/ipfire/xtaccess/config | |
65798afe MT |
27 | /usr/local/bin/setxtaccess |
28 | fi | |
06209efc MT |
29 | ;; |
30 | ||
31 | stop) | |
32 | boot_mesg "Stopping IPFire Seeder..." | |
33 | killproc /usr/bin/rtorrent | |
34 | ;; | |
35 | ||
36 | reload) | |
37 | boot_mesg "Reloading IPFire Seeder..." | |
38 | reloadproc /usr/bin/rtorrent | |
39 | ;; | |
40 | ||
41 | restart) | |
42 | ${0} stop | |
43 | sleep 1 | |
44 | ${0} start | |
45 | ;; | |
46 | ||
47 | status) | |
48 | statusproc /usr/bin/rtorrent | |
49 | ;; | |
50 | ||
51 | *) | |
52 | echo "Usage: ${0} {start|stop|reload|restart|status}" | |
53 | exit 1 | |
54 | ;; | |
55 | esac | |
56 | ||
57 | # End $rc_base/init.d/ipfireseeder |