-
Notifications
You must be signed in to change notification settings - Fork 1
/
regen.sh
executable file
·42 lines (34 loc) · 1.22 KB
/
regen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
#$RedRiver: regen.sh,v 1.10 2010/03/08 20:19:37 andrew Exp $
. /etc/OpenBSDTorrents.conf
cd ${OBT_DIR_HOME}
PIDFILE=${OBT_DIR_HOME}/run/regen.pid
if [ -e ${PIDFILE} ]; then
PID=`head -1 ${PIDFILE}`
kill -0 ${PID} 2> /dev/null
if [ $? -eq 0 ]; then
echo $0 Already running
exit 1
fi
fi
echo $$ > ${PIDFILE}
if [[ $1 != skip ]]; then
echo
echo ${OBT_DIR_HOME}/MakeTorrents.pl $*
${OBT_DIR_HOME}/MakeTorrents.pl $*
fi
echo
echo ${OBT_DIR_HOME}/CurrentTorrents.pl
${OBT_DIR_HOME}/CurrentTorrents.pl
echo "Update /var/opentracker/whitelist";
cat ${OBT_DIR_TORRENT}/allowed.txt > /var/opentracker/whitelist
# permit nopass torrentsync as _opentracker cmd /usr/bin/pkill args -HUP opentracker
doas -u _opentracker /usr/bin/pkill -HUP opentracker
echo "Reload web server"
# permit nopass torrentsync as root cmd /usr/bin/pkill args -HUP -f openbsdtracker-fcgi-pm
doas /usr/bin/pkill -HUP -f openbsdtracker-fcgi-pm
# permit nopass torrentsync as root cmd /usr/local/bin/hypnotoad args /home/OpenBSDTorrents/OpenBSDtracker
#doas /usr/local/bin/hypnotoad /home/OpenBSDTorrents/OpenBSDtracker
echo
#echo ${OBT_DIR_HOME}/SeedTorrents.pl
#${OBT_DIR_HOME}/SeedTorrents.pl