aboutsummaryrefslogtreecommitdiffstats
path: root/net/ntop/files
diff options
context:
space:
mode:
authorlawrance <lawrance@FreeBSD.org>2005-12-12 15:03:16 +0800
committerlawrance <lawrance@FreeBSD.org>2005-12-12 15:03:16 +0800
commit2992949c12c8537177244f8e4f2d67be069c6274 (patch)
treee37b63d92671c20ca2f191e099fd026592fd8899 /net/ntop/files
parent09737f60002bcca49e63b35bad1eb68be513c225 (diff)
downloadfreebsd-ports-gnome-2992949c12c8537177244f8e4f2d67be069c6274.tar.gz
freebsd-ports-gnome-2992949c12c8537177244f8e4f2d67be069c6274.tar.zst
freebsd-ports-gnome-2992949c12c8537177244f8e4f2d67be069c6274.zip
- Install rc.d script with USE_RC_SUBR (PORTREVISION bumped).
- Prompt for ntop admin password and set IS_INTERACTIVE only if necessary. - Quote BROKEN message. - Adds pkg-deinstall with cleanup instructions. - Submitter takes maintainership. PR: ports/90264 Submitted by: Wesley Shields <wxs@csh.rit.edu>
Diffstat (limited to 'net/ntop/files')
-rw-r--r--net/ntop/files/ntop.sh71
-rw-r--r--net/ntop/files/ntop.sh.in29
2 files changed, 29 insertions, 71 deletions
diff --git a/net/ntop/files/ntop.sh b/net/ntop/files/ntop.sh
deleted file mode 100644
index 5e27b03dc87d..000000000000
--- a/net/ntop/files/ntop.sh
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-
-#----------------------------------------------------------------------
-# The following variables may be changed
-#
-
-# Network interface(s) to be monitored;
-# may be blank, or comma-separated list
-interfaces=''
-
-# User to run ntop as; leave blank for root
-userid='nobody'
-
-# [IP:]port for serving HTTP; set to '0' to disable
-http_port='3000'
-
-# [IP:]port for serving HTTPS; set to '0' to disable
-# The certificate is %%PREFIX%%/etc/ntop/ntop-cert.pem
-https_port='3001'
-
-# Directory for ntop.access.log
-logdir='/var/log'
-
-# Specify any additional arguments here - see ntop(8)
-additional_args=''
-
-#
-# End of user-configurable variables
-#----------------------------------------------------------------------
-
-args='-d -L --set-pcap-nonblocking'
-
-[ ! -z $interfaces ] && args="$args -i $interfaces"
-[ ! -z $http_port ] && args="$args -w $http_port"
-[ ! -z $https_port ] && args="$args -W $https_port"
-[ ! -z $logdir ] && args="$args -a ${logdir}/ntop.access.log"
-[ ! -z $userid ] && args="$args -u $userid"
-[ ! -z "$additional_args" ] && args="$args $additional_args"
-
-case "$1" in
-start)
- # is it the first time we run ntop
- [ ! -e %%DBDIR%%/ntop/ntop_pw.db ] && {
- # just in case...
- [ ! -d %%DBDIR%%/ntop ] && {
- echo "Reinstalling database directory"
- mkdir -p %%DBDIR%%/ntop
- chown -R $userid:$userid %%DBDIR%%/ntop
- }
- %%PREFIX%%/bin/ntop -u $userid -A || exit 1
- echo "Now we can start ntop!"
- }
- if [ -d $logdir ]; then
- touch ${logdir}/ntop.access.log
- chown $userid ${logdir}/ntop.access.log
- fi
- if [ -x %%PREFIX%%/bin/ntop ]; then
- %%PREFIX%%/bin/ntop $args > /dev/null 2>&1 &
- echo -n ' ntop'
- fi
- ;;
-stop)
- killall ntop > /dev/null 2>&1 && echo -n ' ntop'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- exit 64
- ;;
-esac
-
-exit 0
diff --git a/net/ntop/files/ntop.sh.in b/net/ntop/files/ntop.sh.in
new file mode 100644
index 000000000000..f2b1fee571ed
--- /dev/null
+++ b/net/ntop/files/ntop.sh.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: ntop
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable ntop:
+#
+#ntop_enable="YES"
+#
+# See ntop(8) for flags
+#
+
+. %%RC_SUBR%%
+
+name=ntop
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/bin/ntop
+
+ntop_enable=${ntop_enable:-"NO"}
+ntop_flags=${ntop_flags:-"-d --use-syslog=daemon"}
+
+load_rc_config $name
+run_rc_command "$1"