aboutsummaryrefslogtreecommitdiffstats
path: root/main/ntop/ntop.initd
blob: ffc2923790dfeb2d60576afa2100fc1f090bc7d3 (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
26
27
28
29
30
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
	need net
}

checkconfig() {
	if [ ! -e /var/lib/ntop/ntop_pw.db ]; then
		eerror "You need to set a password first by running"
		eerror "ntop --set-admin-password"
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting ntop"
	export LC_ALL=C # apparently doesn't work with some locales (#191576 and #205382)
	export GDFONTPATH=/usr/share/fonts/corefonts # apparently the only font that works (#231705)
	start-stop-daemon --start --exec /usr/bin/ntop -- -d -L ${NTOP_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping ntop"
	start-stop-daemon --stop --retry 30 --pidfile /var/run/ntop.pid
	eend $?
}