Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > c75355cc0406caf165ba5173fd3c5d18 > scriptlet

proftpd-anonymous-1.2.10-13mdk.x86_64.rpm

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