PREUN
/bin/sh
if [ $1 = 0 ]; then service proftpd stop > /dev/null 2>/dev/null || :; /sbin/chkconfig --del proftpd; fi;
if [ "$1" = 0 ]; then
if [ -d /var/run/proftpd ]; then
rm -rf /var/run/proftpd/*
fi
fi
if [ -x /usr/sbin/xinetd ];then
if [ $1 = 1 ]; then /sbin/chkconfig --add xinetd; else if [ -f /var/lock/subsys/xinetd ]; then service xinetd restart > /dev/null 2>/dev/null || : ; fi; fi;
fi
POSTIN
/bin/sh
if [ $1 = 1 ]; then /sbin/chkconfig --add proftpd; else if [ -f /var/lock/subsys/proftpd ]; then service proftpd restart > /dev/null 2>/dev/null || : ; fi; fi;
# xinetd reset
# Only do it if xinetd is there. -- Geoff
if [ -x /usr/sbin/xinetd ];then
if [ $1 = 1 ]; then /sbin/chkconfig --add xinetd; else if [ -f /var/lock/subsys/xinetd ]; then service xinetd restart > /dev/null 2>/dev/null || : ; fi; fi;
fi
# ftpusers creation
if [ ! -f /etc/ftpusers ]; then
touch /etc/ftpusers
fi
USERS="root bin daemon adm lp sync shutdown halt mail news uucp operator games nobody"
for i in $USERS ;do
cat /etc/ftpusers | grep -q "^$i$" || echo $i >> /etc/ftpusers
done