[Bug 916] Hylafax 6.0.3 Fails on Freebsd 6.2-RELEASE

[email protected] Tue, 20 Apr 2010 06:15:36 -0400
Newsgroups gmane.comp.telephony.fax.hylafax.devel
Message-ID <[email protected]>
http://bugs.hylafax.org/show_bug.cgi?id=916





------- Comment #13 from [email protected]  2010-04-20 06:15 -------
Hmm, seeing as you're now suggesting specifying a default bind address if no
arguments are given, it raises the possibility of arguments other than the bind
address being passed, meaning that a bind address argument may ever be used.

We could go the whole hog, and add support for the bind address, fax port(s),
SNPP port(s) & additional arguments. This way each variable has a set task,
rather than expecting people to know that the -l argument needs to be added to
HFAXD_ARGS

Something a bit like the following perhaps? I've allowed for a list of Hylafax
& SNPP ports (as specified in the man pages) as well as a generic
HFAXD_EXTRA_ARGS variable, similar to the one in the rpm/init script.

--- hylafax.in.orig     2010-04-20 10:19:04.000000000 +0100
+++ hylafax.in  2010-04-20 11:11:19.000000000 +0100
@@ -77,2 +77,33 @@

+# By default, only bind to the IPv4 localhost
+if [ -z "$HFAXD_LISTEN" ]; then
+    HFAXD_LISTEN='127.0.0.1'
+fi
+
+# By default, bind to the default Hylafax port, but allow for multiple ports
+if [ -z "$HFAXD_FAXPORT" ]; then
+    FAXPORT='-i hylafax'
+else
+    FAXPORT=
+    for port in $HFAXD_FAXPORT; do
+        FAXPORT="$FAXPORT -i $port"
+    done
+fi
+
+# By default, bind to the default SNPP port, but allow for multiple ports
+if [ -z "$HFAXD_SNPPPORT" ]; then
+    SNPPPORT='-s snpp'
+else
+    SNPPORT=
+    for port in $HFAXD_SNPPPORT; do
+        SNPPPORT="$SNPPPORT -s $port"
+    done
+fi
+
+
+# Any additional arguments
+if [ -z "$HFAXD_EXTRA_ARGS" ]; then
+    HFAXD_EXTRA_ARGS=
+fi
+
 IS_ON=/etc/chkconfig           # NB: chkconfig is IRIX- and Linux-specific
@@ -81,4 +112,2 @@
 FAXQUIT=$SBIN/faxquit
-FAXPORT=hylafax                        # designated port for new protocol
-SNPPPORT=444                   # official port for SNPP

@@ -156,6 +185,6 @@
             if test $HFAXD_SERVER = yes ; then
-               HFAXD="$HFAXD -i $FAXPORT"
+               HFAXD="$HFAXD $HFAXD_EXTRA_ARGS -l $HFAXD_LISTEN $FAXPORT"
                HFAXMSG=" hfaxd"
                if [ $HFAXD_SNPP_SERVER = yes ]; then
-                   HFAXD="$HFAXD -s $SNPPPORT"
+                   HFAXD="$HFAXD $SNPPPORT"
                    HFAXMSG="$HFAXMSG (with SNPP support)"


-- 
Configure bugmail: http://bugs.hylafax.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


____________________ HylaFAX(tm) Developers Mailing List ____________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe [email protected] < /dev/null