[Asterisk-Users] Patch zaptel.init to support debian

Karl O. Pinc kop at meme.com
Mon Dec 12 23:26:49 MST 2005


Hi,

Don't know if this is really right, all I know is
that Debian sarge does not have /var/lock/subsys/.

I foolishly made this patch against the zaptel 1.2
branch rather than trunk, although I did check that
the trunk has the problem.  It'll probably apply....

I ran it and it works for me.

Regards,

Karl <kop at meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein

--- zaptel.init.orig	2005-12-12 15:36:34.000000000 -0600
+++ zaptel.init	2005-12-12 17:58:33.855867848 -0600
@@ -30,6 +30,11 @@
      [ -f /etc/sysconfig/zaptel ] && . /etc/sysconfig/zaptel
  fi

+LOCKFILE=/var/lock/subsys/zaptel  # assume redhat
+if [ $system = debian ]; then
+    LOCKFILE=/var/lock/zaptel
+fi
+
  if [ -z "${MODULES}" ]; then
  	# Populate defaults if not present
  	MODULES="tor2 wct4xxp wct1xxp wcte11xp wcfxo wctdm"
@@ -99,7 +104,7 @@
  	fi
  	RETVAL=$?

-        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zaptel
+        [ $RETVAL -eq 0 ] && touch $LOCKFILE
          ;;
    stop)
          # Unload drivers
@@ -120,7 +125,7 @@
  	fi
  	RETVAL=$?

-        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zaptel
+        [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
          ;;
   restart)
  	$0 stop





More information about the asterisk-users mailing list