POSTIN
/bin/sh
if [ $1 = "1" ]; then
cat /etc/proftpd.conf | egrep -q "Include[[:space:]]+/etc/proftpd-anonymous.conf[[:space:]]*$"
if [ $? != "0" ];then
echo -e -n "Include\t\t\t/etc/proftpd-anonymous.conf\n" >> /etc/proftpd.conf
/usr/share/rpm-helper/add-service proftpd $1 proftpd
exit 0
fi
fi
# Enable it if we have this line already.
perl -pi -e "s|#[[:space:]]*Include[[:space:]]+/etc/proftpd-anonymous.conf[[:space:]]*$|Include\t\t\t/etc/proftpd-anonymous.conf|" /etc/proftpd.conf
/usr/share/rpm-helper/add-service proftpd $1 proftpd
POSTUN
/bin/sh
if [ $1 = "0" ]; then
# Remove *active* include file only. Comments stay.
perl -pi -e "s|^[[:space:]]*Include[[:space:]]+/etc/proftpd-anonymous.conf[[:space:]]*$||" /etc/proftpd.conf
/usr/share/rpm-helper/add-service proftpd $1 proftpd
fi