POSTIN
/bin/sh
if [ -f /var/lock/subsys/httpd ]; then
/etc/rc.d/init.d/httpd restart >/dev/null 2>&1 || :
fi
if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
if [ -z "`cat /etc/nagios/passwd|cut -d: -f2`" ]; then
echo "Setting a unique password for the nagios web user. As root look in the /etc/nagios/passwd.plaintext file to view it."
PASSWORD=`perl -e 'for ($i = 0, $bit = "!", $key = ""; $i < 8; $i++) {while ($bit !~ /^[0-9A-Za-z]$/) { $bit = chr(rand(90) + 32); } $key .= $bit; $bit = "!"; } print "$key";'`
/usr/sbin/htpasswd -b /etc/nagios/passwd nagios $PASSWORD
echo "$PASSWORD" > /etc/nagios/passwd.plaintext
chmod 600 /etc/nagios/passwd.plaintext
fi
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
if [ -f /var/lock/subsys/httpd ]; then
/etc/rc.d/init.d/httpd restart >/dev/null 2>&1 || :
fi
fi
if [ "$1" = "0" -a -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi