PREIN
/bin/sh
# Add admin group exist if doesn't exit
# warly
#
# FIXME: if the group admin exists before that install create it
# grpconv failed and the install reboot
#
grep -q '^admin:' /etc/passwd || \
/usr/sbin/useradd -c 'Administrator' \
-d /home/admin -G adm -s /bin/bash admin
grep -q '^httpd-naat:' /etc/passwd || \
/usr/sbin/useradd -c "Httpd Naat Admin" -s /bin/bash -M \
-d /var/www-naat -G admin,apache httpd-naat
PREUN
/bin/sh
/usr/share/rpm-helper/del-service httpd2-naat $1 httpd2-naat
POSTIN
/bin/sh
# verify mod_auth configuration
#if [ -e /etc/httpd//etc/httpd/conf/addon-modules/mod_auth_external.conf ]; then
#echo "Include conf/addon-modules/mod_auth_external.conf" >> /etc/httpd/conf/httpd-naat.conf
#service httpd-naat reload
#fi
# httpd2-naat
if [ -e /usr/sbin/httpd2-perl ]; then
ln -sf /usr/sbin/httpd2-perl /usr/sbin/httpd2-naat
elif [ -e /usr/sbin/httpd2 ]; then
ln -sf /usr/sbin/httpd2 /usr/sbin/httpd2-naat
fi
# make SnortSnarf work
ln -sf /var/www/cgi-bin/*.pl /var/www-naat/cgi-bin/
# make dhcpstatus work
cp -a /var/www/cgi-bin/dhcpstatus*cgi /var/www-naat/cgi-bin/
/usr/share/rpm-helper/add-service httpd2-naat $1 httpd2-naat
# proxy pac
#grep -qw "application/x-ns-proxy-autoconfig" /etc/httpd/conf/apache-mime.types || {
# echo "application/x-ns-proxy-autoconfig pac dat" >> /etc/httpd/conf/apache-mime.types
#}
POSTUN
/bin/sh
#if [ -e /etc/httpd//etc/httpd/conf/addon-modules/mod_auth_external.conf ]; then
#$perl -pi -e "s|Include conf/addon-modules/mod_auth_external.conf\n||g;" \
# /etc/httpd/conf/httpd-naat.conf
#service httpd-naat reload
#fi
#if [ $1 = "0" ]; then # full uninstall
# remove logs
#rm -fr /var/log/httpd-naat/*
# remove user http-naat
#grep -q '^httpd-naat:' /etc/passwd && \
# /usr/sbin/userdel -r httpd-naat 2> /dev/null
#remove the link
#rm -rf /usr/sbin/httpd-naat
#fi