aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ntopng/ntopng.initd
diff options
context:
space:
mode:
Diffstat (limited to 'testing/ntopng/ntopng.initd')
-rw-r--r--testing/ntopng/ntopng.initd25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/ntopng/ntopng.initd b/testing/ntopng/ntopng.initd
new file mode 100644
index 0000000000..c111d2bf00
--- /dev/null
+++ b/testing/ntopng/ntopng.initd
@@ -0,0 +1,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"}
+
+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 $?
+}
+