olsrd: hotplug: dont test if daemon is enabled, but look for a written PID-file....
authorBastian Bittorf <bittorf@bluebottle.com>
Mon, 11 Nov 2013 10:46:17 +0000 (11:46 +0100)
committerBastian Bittorf <bittorf@bluebottle.com>
Mon, 11 Nov 2013 10:46:17 +0000 (11:46 +0100)
olsrd/files/olsrd.hotplug.sh

index 6d1641fa0689ffad75e004ff6804214f04f24c17..db709a8155162896428d3dc4d50382b9ccec9c47 100755 (executable)
@@ -44,9 +44,11 @@ olsrd_interface_needs_adding()
 
 case "$ACTION" in
        ifup)
-               /etc/init.d/olsrd enabled && {
+               # only work after the first normal startup
+               # also: no need to test, if enabled
+               [ -e '/var/run/olsrd.pid' ] && {
                        olsrd_interface_needs_adding "$INTERFACE" "$DEVICE" && {
-                               /etc/init.d/olsrd restart
+                               . /etc/rc.common /etc/init.d/olsrd restart
                        }
                }
        ;;