freebsd-ports/net/ntopng/files/ntopng.in
Guido Falsi eb38a8f594 - Correct GeoIP update script
- Install GeoIP update script only when GEOIP option is enabled
- Add deinstall script to cleanup GeoIP dat file downloaded with
  the  provided script
- Fix startup script REQUIREs
- Move -e argument to end of command line as suggested by upstream
  to avoid conflicts with other user provided options
- Remove reference to unspecified security vulnerabilities in
  pkg-message, leaving a generic suggestion to protect public services
- While here reword pkg-message and add suggestion on how to provide
  a configuration file to ntopng

Thanks to Simone Mainardi <mainardi at ntop.org> (upstream developer)
for his suggesting most of the above changes and his help.
2017-02-16 14:51:05 +00:00

47 lines
1 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ntopng
# REQUIRE: LOGIN netif
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable ntopng:
#
# ntopng_enable (bool): Set it to "YES" to enable ntopng
# Default is "NO".
# ntopng_flags (flags): Set extra flags to ntopng
# Empty by default.
# ntopng_pidfile (path): Path to the pidfile
# Default /var/run/ntopng/ntopng.pid
#
. /etc/rc.subr
name=ntopng
desc="Monitors network traffic in realtime"
rcvar=ntopng_enable
load_rc_config $name
: ${ntopng_enable:=NO}
: ${ntopng_pidfile:=/var/run/ntopng/ntopng.pid}
httpdocs_path=%%DATADIR%%/httpdocs
scripts_path=%%DATADIR%%/scripts
callbacks_path=%%DATADIR%%/scripts/callbacks
user_path=%%PREFIX%%/etc/ntopng-users.conf
start_precmd=ntopng_precmd
command=%%PREFIX%%/bin/ntopng
command_args="-U ntopng -G ${ntopng_pidfile} -1 ${httpdocs_path} -2 ${scripts_path} -3 ${callbacks_path} -e"
ntopng_precmd()
{
local rundir=${ntopng_pidfile%/*}
if [ ! -d $rundir ] ; then
install -d -m 0755 -o ntopng -g ntopng $rundir
fi
}
run_rc_command "$1"