-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathopentracker
executable file
·41 lines (38 loc) · 1.17 KB
/
opentracker
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
#! /bin/sh
### BEGIN INIT INFO
# Provides: opentracker
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Opentracker init script
# Description: This a init script for Opentracker (a bittorrent tracker).
### END INIT INFO
### Configuration // Configuracion ###
#
# Configure file // Archivo de configuracion:
CONF_FILE=/full/path/of/config/file
#
# Opentracker binary // Ejecutable de Opentracker:
BIN=/full/path/of/binary
#
# Black list file // Archivo de Black list
BLACK_LIST=/full/path/of/the/file/black.list
#
### End of Configuration // Fin de configuracion ###
case "$1" in
start)
echo -n "Starting Open Bittorrent Tracker ..."
$BIN -f $CONF_FILE -b $BLACK_LIST> /dev/null &
echo " [ OK ]"
echo "."
;;
stop)
echo -n "Stopping Open Bittorrent Tracker"
kill `ps auxw | grep "$BIN -f $CONF_FILE" | awk '{print $2}'` > /dev/null
echo "."
;;
*)
echo "Usage: /etc/init.d/opentracker {start|stop}"
exit 1
esac