Package apache2-base: Scripts

Post install

1
2
3
4
5
6
7
8
if [ ! -e /etc/httpd2/conf/httpd2.conf ] && \
		[ -e /etc/httpd2/conf/httpd2.conf.rpmnew ]; then
	mv /etc/httpd2/conf/httpd2.conf.rpmnew /etc/httpd2/conf/httpd2.conf
fi
if [ $1 -eq 1 ]; then
	/usr/sbin/post_service httpd2
fi
exit 0
Pre install

# Create user and groups
/usr/sbin/groupadd -r -f apache2 2>/dev/null ||:
/usr/sbin/groupadd -r -f webmaster 2>/dev/null ||:
/usr/sbin/useradd -g apache2 -c 'Apache2 WWW server' -d /var/www -s '/dev/null' \
	-G _webserver -r apache2 2>/dev/null || :
if LANG=C /usr/bin/id apache2 2>/dev/null | \
		grep -qv "groups=[^[:space:]]*(_webserver)"; then
	echo 'Warning: User apache2 was not included in the group _webserver!'
	/usr/bin/gpasswd -a apache2 _webserver
	echo '     Added user apache2 to group _webserver.'
fi
if [ $1 -eq 2 ]; then
	if [ -e /etc/httpd2/conf/httpd2.conf ] && \
			! (grep -qs -m1 '^[[:space:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:space:]]\+conf/ports-enabled' /etc/httpd2/conf/httpd2.conf && \
			grep -qs -m1 '^[[:space:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:space:]]\+conf/mods-enabled' /etc/httpd2/conf/httpd2.conf && \
			grep -qs -m1 '^[[:space:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:space:]]\+conf/sites-enabled' /etc/httpd2/conf/httpd2.conf && \
			grep -qs -m1 '^[[:space:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:space:]]\+conf/extra-enabled' /etc/httpd2/conf/httpd2.conf) ; then
		echo 'Warning: configuration files /etc/httpd2/conf/httpd2.conf is old!'
		echo '    Renamed old file /etc/httpd2/conf/httpd2.conf'
		echo '    to /etc/httpd2/conf/httpd2.conf.rpmsave'
		mv /etc/httpd2/conf/httpd2.conf /etc/httpd2/conf/httpd2.conf.rpmsave
	fi
	if [ -e /etc/httpd2/conf/httpd2.worker.conf ] && \
			[ ! -L /etc/httpd2/conf/httpd2.worker.conf ]; then
		echo 'Warning: original configuration files /etc/httpd2/conf/httpd2.worker.conf'
		echo '    saved as /etc/httpd2/conf/httpd2.worker.conf.rpmold'
		mv /etc/httpd2/conf/httpd2.worker.conf /etc/httpd2/conf/httpd2.worker.conf.rpmold
	fi
fi
exit 0
Pre uninstall

1
2
3
4
if [ $1 -eq 0 ]; then
    /usr/sbin/preun_service httpd2
fi
exit 0