diff options
author | Sergey Skvortsov <skv@FreeBSD.org> | 2003-08-22 14:11:09 +0000 |
---|---|---|
committer | Sergey Skvortsov <skv@FreeBSD.org> | 2003-08-22 14:11:09 +0000 |
commit | a21e7a241741db29ac3685f44a4ae80d6a89c94b (patch) | |
tree | 7893225dc68488d6c030d89f21df32764a22bdb7 /net-mgmt | |
parent | 288af27a1779c81e1083963f82fd411230d97cdc (diff) | |
download | ports-a21e7a241741db29ac3685f44a4ae80d6a89c94b.tar.gz ports-a21e7a241741db29ac3685f44a4ae80d6a89c94b.zip |
Notes
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/ipacctd/Makefile | 35 | ||||
-rw-r--r-- | net-mgmt/ipacctd/distinfo | 1 | ||||
-rw-r--r-- | net-mgmt/ipacctd/files/ipacctd.sh.sample | 72 | ||||
-rw-r--r-- | net-mgmt/ipacctd/pkg-descr | 8 | ||||
-rw-r--r-- | net-mgmt/ipacctd/pkg-plist | 5 |
5 files changed, 121 insertions, 0 deletions
diff --git a/net-mgmt/ipacctd/Makefile b/net-mgmt/ipacctd/Makefile new file mode 100644 index 000000000000..2e8fc8cf06e7 --- /dev/null +++ b/net-mgmt/ipacctd/Makefile @@ -0,0 +1,35 @@ +# New ports collection makefile for: ipacctd +# Date created: 22 Aug 2003 +# Whom: Sergey Skvortsov <skv@protey.ru> +# +# $FreeBSD$ +# + +PORTNAME= ipacctd +PORTVERSION= 1.46 +CATEGORIES= net +MASTER_SITES= ftp://ftp.wuppy.net.ru/pub/FreeBSD/local/ipacctd/ + +MAINTAINER= skv@FreeBSD.org +COMMENT= IP accounting using divert socket + +STARTUP_SCRIPT= ipacctd.sh.sample +PLIST_SUB= STARTUP_SCRIPT=${STARTUP_SCRIPT} + +WRKSRC= ${WRKDIR}/${PORTNAME} +MAKE_ENV+= BINDIR="${PREFIX}/sbin" + +MAN8= ipacctd.8 +MANLANG= "" ru.KOI8-R +MANCOMPRESSED= yes + +post-install: +.ifndef(NOPORTDOCS) + @${ECHO_MSG} "===> Installing documentation for ${PKGNAME}" + @${MKDIR} ${DOCSDIR}/ru + @${INSTALL_DATA} ${WRKSRC}/README.ipacctd ${DOCSDIR}/ru +.endif + ${INSTALL_SCRIPT} ${FILESDIR}/${STARTUP_SCRIPT} \ + ${PREFIX}/etc/rc.d/${STARTUP_SCRIPT} + +.include <bsd.port.mk> diff --git a/net-mgmt/ipacctd/distinfo b/net-mgmt/ipacctd/distinfo new file mode 100644 index 000000000000..137a298715b5 --- /dev/null +++ b/net-mgmt/ipacctd/distinfo @@ -0,0 +1 @@ +MD5 (ipacctd-1.46.tar.gz) = 34cce133b21973eaf050a9df943b7eff diff --git a/net-mgmt/ipacctd/files/ipacctd.sh.sample b/net-mgmt/ipacctd/files/ipacctd.sh.sample new file mode 100644 index 000000000000..90e85c15b81d --- /dev/null +++ b/net-mgmt/ipacctd/files/ipacctd.sh.sample @@ -0,0 +1,72 @@ +#!/bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +# If there is a global system configuration file, suck it in. +if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs +elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf +fi + +ipacctd_enable=${ipacctd_enable:-YES} +ipacctd_program=${ipacctd_program:-${PREFIX}/sbin/ipacctd} +ipacctd_flags=${ipacctd_flags:-"-v"} + +#ipacctd_log_base=${ipacctd_log_base:-/var/log/ipacct} +#ipacctd_log_ext=${ipacctd_log_ext:-%Y-%m-%d-%T} + +ipacctd_rules="xl0 ppp0" + +ipacctd_rule_xl0_flags="" +ipacctd_rule_xl0_pid="/var/run/ipacctd.xl0" + +ipacctd_rule_ppp0_flags="" +ipacctd_rule_ppp0_pid="/var/run/ipacctd.ppp0" + +case "$1" in +start) + case "${ipacctd_enable}" in + [Yy][Ee][Ss]) + if [ -f ${ipacctd_program} ]; then + echo -n ' ipacctd [' + + for rule in ${ipacctd_rules}; do + echo -n " ${rule}" + + eval ipacctd_rule_flags=\$ipacctd_rule_${rule}_flags + if [ -z $ipacctd_rule_flags ]; then + echo " you must define flags for rule ${rule}" + exit 1 + fi + + eval ipacctd_rule_pid=\${ipacctd_rule_${rule}_pid:-"/var/run/ipacctd.${rule}"} + + ${ipacctd_program} \ + ${ipacctd_flags} \ + ${ipacctd_rule_flags} \ + -r ${ipacctd_rule_pid} + + done + echo -n " ]" + fi + ;; + esac + ;; +stop) + for rule in ${ipacctd_rules}; do + eval ipacctd_rule_pid=\${ipacctd_rule_${rule}_pid:-"/var/run/ipacctd.${rule}"} + kill `cat ${ipacctd_rule_pid}` + done + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + ;; +esac + +exit 0 + diff --git a/net-mgmt/ipacctd/pkg-descr b/net-mgmt/ipacctd/pkg-descr new file mode 100644 index 000000000000..26a342ef10b7 --- /dev/null +++ b/net-mgmt/ipacctd/pkg-descr @@ -0,0 +1,8 @@ +The ipacctd is intended for IP accounting. divert(4) and corresponding +ipfw(8) rules are used for obtaining IP packets. + +Author: Roman V. Palagin <romanp@unshadow.net> +FTP: ftp://ftp.wuppy.net.ru/pub/FreeBSD/local/ipacctd/ + +-- Sergey Skvortsov +skv@FreeBSD.org diff --git a/net-mgmt/ipacctd/pkg-plist b/net-mgmt/ipacctd/pkg-plist new file mode 100644 index 000000000000..5715a08c9d96 --- /dev/null +++ b/net-mgmt/ipacctd/pkg-plist @@ -0,0 +1,5 @@ +sbin/ipacctd +etc/rc.d/%%STARTUP_SCRIPT%% +%%PORTDOCS%%%%DOCSDIR%%/ru/README.ipacctd +%%PORTDOCS%%@dirrm %%DOCSDIR%%/ru +%%PORTDOCS%%@dirrm %%DOCSDIR%% |