Tracker daemon

This commit is contained in:
Bob Mottram 2015-08-29 23:00:56 +01:00
parent 711c30891a
commit 3b78a97f1d
1 changed files with 25 additions and 0 deletions

View File

@ -1650,11 +1650,36 @@ function install_zeronet {
echo '[Install]' >> /etc/systemd/system/zeronet.service echo '[Install]' >> /etc/systemd/system/zeronet.service
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/zeronet.service echo 'WantedBy=multi-user.target' >> /etc/systemd/system/zeronet.service
echo '[Unit]' > /etc/systemd/system/tracker.service
echo 'Description=Torrent Tracker' >> /etc/systemd/system/tracker.service
echo 'After=syslog.target' >> /etc/systemd/system/tracker.service
echo 'After=network.target' >> /etc/systemd/system/tracker.service
echo '[Service]' >> /etc/systemd/system/tracker.service
echo 'Type=simple' >> /etc/systemd/system/tracker.service
echo 'User=tracker' >> /etc/systemd/system/tracker.service
echo 'Group=tracker' >> /etc/systemd/system/tracker.service
echo 'WorkingDirectory=/opt/tracker' >> /etc/systemd/system/tracker.service
echo 'ExecStart=bttrack --port 6969 --dfile /opt/tracker/dstate --logfile /opt/tracker/tracker.log --nat_check 0 --scrape_allowed full' >> /etc/systemd/system/tracker.service
echo '' >> /etc/systemd/system/tracker.service
echo 'TimeoutSec=300' >> /etc/systemd/system/tracker.service
echo '' >> /etc/systemd/system/tracker.service
echo '[Install]' >> /etc/systemd/system/tracker.service
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/tracker.service
useradd -d /opt/tracker/ -s /bin/false tracker
if [ ! -d /opt/tracker ]; then
mkdir /opt/tracker
fi
chown -R tracker:tracker /opt/tracker
# publish regularly # publish regularly
if ! grep -Fxq "zeronetavahi" /etc/crontab; then if ! grep -Fxq "zeronetavahi" /etc/crontab; then
echo "* * * * * root zeronetavahi > /dev/null" >> /etc/crontab echo "* * * * * root zeronetavahi > /dev/null" >> /etc/crontab
fi fi
systemctl enable tracker.service
systemctl start tracker.service
systemctl enable zeronet.service systemctl enable zeronet.service
systemctl start zeronet.service systemctl start zeronet.service