pkg-deinstall

#!/bin/sh
#
# $FreeBSD: ports/net-mgmt/ifgraph/pkg-deinstall,v 1.1 2003/12/08 20:51:56 krion Exp $
#

PATH=/bin:/usr/bin:/usr/sbin

case $2 in

DEINSTALL)
echo '---> Starting deinstall script:'

echo '---> Zeroing crontab(5) file belonging to user "%%USER%%"'
/usr/bin/crontab -u %%USER%% /dev/null
echo ' (The crontab(5) will be deleted completely when user "%%USER%%" is removed.)'

;;

POST-DEINSTALL)
echo '---> Starting post-deinstall script:'

if [ -f %%PREFIX%%/etc/ifgraph.conf -o \
-d %%PREFIX%%/ifgraph -o \
-d %%PREFIX%%/var/ifgraph ]; then
echo '---> You seem to have made some custom ifGraph configuration.'
echo '---> - The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
echo '---> - You may delete them with "pw groupdel %%GROUP%%; pw userdel %%USER%%".'

else
echo '---> Removing group "%%GROUP%%"'
/usr/sbin/pw groupdel -n %%GROUP%%
echo '---> Removing user "%%USER%%"'
echo 'y' | /usr/sbin/pw userdel -n %%USER%%
fi

;;

esac

pkg-descr

ifGraph is a set of Perl scripts created to help network administrators
to visualize network flow on a daily, weekly, monthly, and yearly basis.
The graphics are created with RRDTool, and it shows bytes (in/out) and
errors for each interface. It also shows the current/average/max use and
the respective link/interface usage in percentages. The program also
outputs HTML files to make the visualization of the PNG/GIF/GD images
more friendly and easy.

WWW: http://ifgraph.sourceforge.net/

- Lars Thegler
lars@thegler.dk

pkg-install

#!/bin/sh
#
# $FreeBSD: ports/net-mgmt/ifgraph/pkg-install,v 1.1 2003/12/08 20:51:56 krion Exp $
#

PATH=/bin:/usr/bin:/usr/sbin

case $2 in

PRE-INSTALL)
echo "---> Starting pre-install script:"

if [ -z "%%USER%%" -o \
-z "%%GROUP%%" ]; then
echo "ERROR: A required pragma was empty"
exit 1
fi

if pw showgroup "%%GROUP%%" 2>/dev/null; then
echo "---> Using existing group \"%%GROUP%%\""
else
echo "---> Adding group \"%%GROUP%%\""
pw addgroup %%GROUP%% -h - || exit 1
fi

# Create user if required
if pw showuser "%%USER%%" 2>/dev/null; then
echo "---> Using existing user \"%%USER%%\""
else
echo "---> Adding user \"%%USER%%\""
pw adduser %%USER%% -g %%GROUP%% -h - \
-s "/sbin/nologin" -c "ifGraph User" || exit 1
fi

;;

POST-INSTALL)
echo "---> Starting post-install script:"

if [ -z "%%USER%%" -o \
-z "%%PREFIX%%" ]; then
echo "ERROR: A required pragma was empty"
exit 1
fi

echo "---> Creating crontab(5) file for user \"%%USER%%\""
crontab -u "%%USER%%" "%%PREFIX%%/ifgraph/crontab.in" || exit 1

;;

esac

pkg-message

=================================================================

ifGraph has now been installed in %%PREFIX%%/ifgraph/.

NOTE: A sample configuration files has been placed at:

%%PREFIX%%/etc/ifgraph.conf.sample

You need to copy this to

%%PREFIX%%/etc/ifgraph.conf

and edit it to suit your requirements.

A sample crontab(5) entry has been installed. You need to activate
this to start measurements and graph generation. You can do this
with

crontab -u ifgraph -e

Documentation is installed in

%%DOCSDIR%%/

To enable Apache web access, add the following to your
%%PREFIX%%/etc/apache/httpd.conf:

Alias /ifgraph/ %%PREFIX%%/ifgraph/htdocs/

Enjoy!

=================================================================

pkg-plist

@exec mkdir -p %D/ifgraph/htdocs
@exec mkdir -p %D/var/ifgraph
@exec chown ifgraph:ifgraph %D/var/ifgraph
bin/find-if.pl
bin/ifgraph.pl
bin/makegraph.pl
etc/ifgraph.conf.sample
ifgraph/crontab.in
ifgraph/lib/rgb.txt
ifgraph/templates/en/if-data.html
ifgraph/templates/en/if-header.html
ifgraph/templates/en/if-trailer.html
ifgraph/templates/en/main-data.html
ifgraph/templates/en/main-header.html
ifgraph/templates/en/main-trailer.html
ifgraph/templates/es/if-data.html
ifgraph/templates/es/if-header.html
ifgraph/templates/es/if-trailer.html
ifgraph/templates/es/main-data.html
ifgraph/templates/es/main-header.html
ifgraph/templates/es/main-trailer.html
ifgraph/templates/ifgraph-logo.jpg
ifgraph/templates/pt-br/if-data.html
ifgraph/templates/pt-br/if-header.html
ifgraph/templates/pt-br/if-trailer.html
ifgraph/templates/pt-br/main-data.html
ifgraph/templates/pt-br/main-header.html
ifgraph/templates/pt-br/main-trailer.html
@dirrm ifgraph/templates/en
@dirrm ifgraph/templates/es
@dirrm ifgraph/templates/pt-br
@dirrm ifgraph/templates
@dirrm ifgraph/htdocs
@dirrm ifgraph/lib
@dirrmtry ifgraph
@dirrmtry var/ifgraph
@dirrmtry var
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
%%PORTDOCS%%%%DOCSDIR%%/INSTALACAO
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
%%PORTDOCS%%%%DOCSDIR%%/TODO
%%PORTDOCS%%%%DOCSDIR%%/LICENSE.TXT
%%PORTDOCS%%%%DOCSDIR%%/MUDANCAS
%%PORTDOCS%%@dirrm %%DOCSDIR%%