From: Bastian Bittorf Date: Wed, 25 Sep 2013 13:30:15 +0000 (+0200) Subject: olsrd: hotplug-script: cleanup/simplify X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=8ffcb5e3e5c77e9af7e2bc410e18132c8d6c611c;p=lede-routing%2F.git olsrd: hotplug-script: cleanup/simplify --- diff --git a/olsrd/files/olsrd.hotplug.sh b/olsrd/files/olsrd.hotplug.sh index 467156f..8d88737 100755 --- a/olsrd/files/olsrd.hotplug.sh +++ b/olsrd/files/olsrd.hotplug.sh @@ -1,7 +1,14 @@ #!/bin/sh -[ "$ACTION" = ifup ] || exit 0 -/etc/init.d/olsrd enabled || exit 0 +case "$ACTION" in + ifup) + /etc/init.d/olsrd enabled && { + olsrd_interface_needs_adding "$INTERFACE" "$DEVICE" && { + /etc/init.d/olsrd restart + } + } + ;; +esac olsrd_list_configured_interfaces() { @@ -44,7 +51,3 @@ olsrd_interface_needs_adding() logger -t olsrd_hotplug -p daemon.debug "[OK] interface $INTERFACE not used for olsrd" return 1 } - -olsrd_interface_needs_adding "$INTERFACE" "$DEVICE" && { - /etc/init.d/olsrd restart -}