Package webalizer: Scripts

Post install

# get hostname.  This way till we have a macro.
W_HOST=`hostname`
[ $? = 0 ] || W_HOST=localhost
[ $? = 0 ] && {
	/usr/bin/subst "s,__HOST__,$W_HOST,g" /etc/webalizer/apache.conf ||:
}
[ $? = 0 ] && {
	/usr/bin/subst "s,__HOST__,$W_HOST,g" /etc/webalizer/vsftpd.conf ||:
}
[ -f "/etc/webalizer.conf" ] && \
echo "NB: default webalizer configuration place is under /etc/webalizer/ now
to allow for easier management of .conf files; you may want to look there
and/or update your setup." ||:

[ -f "/var/lib/webalizer/dns_cache.db" ] && \
	db_upgrade -v /var/lib/webalizer/dns_cache.db

#%postun
#/usr/sbin/userdel webalizer

# fix awful user/group deletion in previous spec versions :(
Pre install

1
2
3
4
5
6
7
8
/bin/grep -q "^webalizer:" /etc/group \
|| /usr/sbin/groupadd -r -f webalizer ||:
/bin/grep -q "^webalizer:" /etc/passwd \
|| /usr/sbin/useradd -g webalizer -G apache -c 'The Webalizer' \
	-d /var/lib/webalizer -s /dev/null -r webalizer ||: 
if LANG=C /usr/bin/id -Gn apache2 >/dev/null 2>&1;then \
	 /usr/sbin/usermod -G apache,apache2 webalizer ||:
fi