d838e8fa85
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>
52 lines
1.0 KiB
Bash
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
|