]> git.pld-linux.org Git - packages/pure-ftpd.git/commitdiff
- added detection for available parsers
authortwittner <twittner@pld-linux.org>
Mon, 8 Nov 2004 20:34:27 +0000 (20:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  pure-config - binary (in extra bcond),
  pure-config.pl - perl script (default in PLD),
  pure-config.py - python script

Changed files:
    pure-ftpd.init -> 1.10

pure-ftpd.init

index 6b80baa540fe353dbd1e4cad4cb0bbfbd604dfa0..9755edd485f7cd12f4fea45f6f9d18c93e843f8c 100644 (file)
 # 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 -a "$1" != stop -a "$1" != status ]; then
@@ -34,8 +46,15 @@ case "$1" in
        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
This page took 0.031237 seconds and 4 git commands to generate.