e632d0
diff -up openslp-2.0.0/etc/slpd.all_init.orig openslp-2.0.0/etc/slpd.all_init
e632d0
--- openslp-2.0.0/etc/slpd.all_init.orig	2012-11-28 18:07:04.000000000 +0100
e632d0
+++ openslp-2.0.0/etc/slpd.all_init	2017-10-04 12:50:36.672953246 +0200
e632d0
@@ -1,28 +1,5 @@
e632d0
 #!/bin/bash
e632d0
-#
e632d0
-#	/etc/rc.d/init.d/slpd
e632d0
-#
e632d0
-# slpd    Start/Stop the OpenSLP SA daemon (slpd).
e632d0
-#
e632d0
-# chkconfig: 345 13 87
e632d0
-# description: OpenSLP daemon for the Service Location Protocol
e632d0
-# processname: slpd
e632d0
-
e632d0
-# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
e632d0
-#     Modified for RHS Linux by Damien Neil
e632d0
-#     Modified for COL by Raymund Will, <ray@lst.de>
e632d0
-#     Modified for OpenSLP by Matt Peterson <mpeterson@calderasystems.com>
e632d0
-#     Modified to be distribution agnostic by Bart Whiteley <bart@caldera.com>
e632d0
-
e632d0
-#//////////////////////////////////////////////////#
e632d0
-# Does nothing if a route exists that supports     # 
e632d0
-# multicast traffic. If no routes supporting       #
e632d0
-# multicast traffic exists, the function tries to  #
e632d0
-# add one.  A 0 is returned on success and a 1     #
e632d0
-# on failure. One parameter must be passed in.     #
e632d0
-# This variable determins verbosity. If parameter  #
e632d0
-# is non-zero debugging will appear                #
e632d0
-#//////////////////////////////////////////////////#
e632d0
+
e632d0
 multicast_route_set() 
e632d0
 {
e632d0
     PING_OPTIONS_1='-c1 -w1'
e632d0
@@ -36,8 +13,8 @@ multicast_route_set()
e632d0
     MSG_FAILED_TO_ADD=' FAILED - Route NOT Added.'
e632d0
     MSG_SUCCES_ON_ADD=' SUCCESS - Route Added.'
e632d0
 
e632d0
-    CMD_GET_INTERFACE="netstat -i | awk 'BEGIN{}(NR>2)&&(!/^lo*/){print \$1}'"
e632d0
-    CMD_ADD_ROUTE="route add -net 224.0.0.0 netmask 240.0.0.0"
e632d0
+    CMD_GET_INTERFACE="ip -o link show | awk 'BEGIN{FS=\": \"}!/^:digit:+: lo:.*/{print \$2}'"
e632d0
+    CMD_ADD_ROUTE="ip route add 224.0.0.0/4 dev"
e632d0
 
e632d0
     err_unreachable_found=`ping $PING_OPTIONS_1 $MULTICAST_ADDRESS 2>&1 1>/dev/null`
e632d0
 
e632d0
@@ -91,94 +68,11 @@ multicast_route_set()
e632d0
     return $retval
e632d0
 }
e632d0
 
e632d0
-NAME=slpd
e632d0
-DAEMON=/usr/sbin/$NAME  
e632d0
-SUSE=0
e632d0
-
e632d0
-# Change to root
e632d0
-OLDDIR=`pwd`
e632d0
-cd /
e632d0
-
e632d0
-# Source function library.
e632d0
-if [ -f /etc/rc.d/init.d/functions ]; then
e632d0
-  . /etc/rc.d/init.d/functions
e632d0
-else
e632d0
-  SUSE=1
e632d0
-fi
e632d0
-  
e632d0
-test -x $DAEMON || exit 0
e632d0
-
e632d0
-if [ ! "$SVIlock" = "" ]; then
e632d0
-  unset LOCK
e632d0
-else
e632d0
-  LOCK=/var/lock/subsys/slpd
e632d0
+multicast_route_set 1
e632d0
+multicast_enabled=$?
e632d0
+if [ "$multicast_enabled" != "0" ] ; then
e632d0
+  echo "Failure: No Route Available for Multicast Traffic"
e632d0
+  exit 1
e632d0
 fi
e632d0
 
e632d0
-RETVAL=0
e632d0
-
e632d0
-#
e632d0
-#	See how we were called.
e632d0
-#
e632d0
-case "$1" in
e632d0
-  start)
e632d0
-    # Check if atd is already running
e632d0
-    # RH style
e632d0
-    if [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ -f $LOCK ]; then
e632d0
-      exit 0
e632d0
-    fi
e632d0
-    # Caldera Style
e632d0
-    if [ ! "$SVIlock" = "" ] && [ -f $SVIlock ]; then
e632d0
-      exit 0
e632d0
-    fi
e632d0
-    echo -n 'Starting slpd: '
e632d0
-
e632d0
-    multicast_route_set 1
e632d0
-    multicast_enabled=$?
e632d0
-    if [ "$multicast_enabled" != "0" ] ; then
e632d0
-      echo "Failure: No Route Available for Multicast Traffic"
e632d0
-      exit 1
e632d0
-    fi
e632d0
-    if [ $SUSE -eq 0 ]; then
e632d0
-      if [ -x /sbin/ssd ]; then
e632d0
-        ssd -S -n $NAME -x $DAEMON -- $OPTIONS
e632d0
-        [ ! "$SVIlock" = "" ] && touch $SVIlock
e632d0
-      else
e632d0
-        daemon $DAEMON
e632d0
-        RETVAL=$?
e632d0
-      fi
e632d0
-    else
e632d0
-      startproc $DAEMON $OPTIONS
e632d0
-    fi
e632d0
-    [ $SUSE -eq 0 ] && [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && touch $LOCK
e632d0
-    echo
e632d0
-    ;;
e632d0
-  stop)
e632d0
-    echo -n 'Stopping slpd: '
e632d0
-    
e632d0
-    if [ -x /sbin/ssd ]; then
e632d0
-      ssd -K -p /var/run/$NAME.pid -n $NAME
e632d0
-      [ ! "$SVIlock" = "" ] && rm -f $SVIlock
e632d0
-    else
e632d0
-      killproc $DAEMON
e632d0
-      RETVAL=$?
e632d0
-    fi
e632d0
-    [ ! "$LOCK" = "" ] && [ $RETVAL -eq 0 ] && rm -f $LOCK
e632d0
-    echo
e632d0
-    ;;
e632d0
-  reload|restart)
e632d0
-    cd $OLDDIR
e632d0
-    $0 stop
e632d0
-    $0 start
e632d0
-	 cd /
e632d0
-    RETVAL=$?
e632d0
-    ;;
e632d0
-  status)
e632d0
-    status /usr/sbin/slpd
e632d0
-    RETVAL=$?
e632d0
-    ;;
e632d0
-  *)
e632d0
-    echo "Usage: /etc/rc.d/init.d/slpd {start|stop|restart|reload|status}"
e632d0
-    exit 1
e632d0
-esac
e632d0
-
e632d0
-exit $RETVAL
e632d0
+exit 0