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