aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ntopng/ntopng.initd
blob: 824c13a96044267de09fa1cedb4007630d70ee58 (plain)
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
#!/sbin/openrc-run

depend() {
	need net redis
}

command="/usr/bin/ntopng"
pidfile="/var/run/ntopng/ntopng.pid"
: ${exec_user:=ntop}
: ${command_args:="--daemon --data-dir /var/lib/ntopng --httpdocs-dir /usr/share/ntopng/httpdocs --pid $pidfile -U $exec_user $NTOPNG_OPTS"}

checkconfig() {
	if [ ! -e /usr/share/ntopng/httpdocs/geoip/GeoIPASNum.dat ] || \
	[ ! -e /usr/share/ntopng/httpdocs/geoip/GeoLiteCity.dat ]; then
		eerror "You need download the GeoIP database"
		eerror "ntopng-update-geoip-db"
		return 1
	fi
}

prestart() {
	checkconfig || return 1
	eend $?
}