freebsd-ports/net-mgmt/ifgraph/pkg-install
Kirill Ponomarev d838e8fa85 Add ifgraph 0.4.9,
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.

PR:		57421
Submitted by:	Lars Thegler <lars@thegler.dk>
2003-12-08 20:51:57 +00:00

52 lines
1.0 KiB
Bash

#!/bin/sh
#
# $FreeBSD$
#
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