# Get service config
[ -f /etc/sysconfig/pure-ftpd ] && . /etc/sysconfig/pure-ftpd
+# Check for available parsers
+if [ -x /usr/sbin/pure-config ] ; then
+ CFG=/usr/sbin/pure-config
+elif [ -x /usr/sbin/pure-config.pl -a -x /usr/bin/perl ] ; then
+ CFG=/usr/sbin/pure-config.pl
+elif [ -x /usr/sbin/pure-config.py -a -x /usr/bin/python ] ; then
+ CFG=/usr/sbin/pure-config.py
+else
+ echo 'Error: pure-config{.pl,py} not found. Giving up.'
+ exit 1
+fi
+
# Check that networking is up.
if is_yes "${NETWORKING}"; then
- if [ ! -f /var/lock/subsys/network ]; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
# nls "ERROR: Networking is down. %s can't be run." <service>
msg_network_down pure-ftpd
exit 1
if [ ! -f /var/lock/subsys/pure-ftpd ]; then
msg_starting pure-ftpd
rm -f /var/run/pure-ftpd/client*
- daemon pure-config.pl /etc/ftpd/pureftpd.conf --daemonize
- RETVAL=$?
+ if [ x"$CFG" = "x/usr/sbin/pure-config" ] ; then
+ daemon /usr/sbin/pure-ftpd \
+ $(/usr/sbin/pure-config -f /etc/ftpd/pureftpd.conf) \
+ --daemonize
+ RETVAL=$?
+ else
+ daemon $CFG /etc/ftpd/pureftpd.conf --daemonize
+ RETVAL=$?
+ fi
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd
else
msg_already_running pure-ftpd