diff options
author | John Crispin <blogic@openwrt.org> | 2016-04-29 11:35:15 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2016-06-19 19:16:43 +0200 |
commit | 243887c4787ea2b4a29019375f3e6096a40b9c77 (patch) | |
tree | 1e4ed88338c4bcd9d39d3047a5a9710aa3e04bc8 /package/network/services | |
parent | 98a9b0d65faa0e5b68afec765e88823b4a671e2e (diff) | |
download | master-187ad058-243887c4787ea2b4a29019375f3e6096a40b9c77.tar.gz master-187ad058-243887c4787ea2b4a29019375f3e6096a40b9c77.tar.bz2 master-187ad058-243887c4787ea2b4a29019375f3e6096a40b9c77.zip |
dropbear: Add procd interface triggers when interface config is specified
A dropbear instance having an interface config won't start if the interface is down as no
IP address is available.
Adding interface triggers for each configured interface executing the dropbear reload script
will start the dropbear instance when the interface is up.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49272 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services')
-rw-r--r-- | package/network/services/dropbear/Makefile | 2 | ||||
-rwxr-xr-x | package/network/services/dropbear/files/dropbear.init | 22 |
2 files changed, 22 insertions, 2 deletions
diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 39ab04bb54..f48c2b5b2c 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2015.71 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init index 03745c995b..5c3345d40c 100755 --- a/package/network/services/dropbear/files/dropbear.init +++ b/package/network/services/dropbear/files/dropbear.init @@ -106,6 +106,12 @@ keygen() chmod 0700 /etc/dropbear } +load_interfaces() +{ + config_get interface "$1" Interface + interfaces=" ${interface} ${interfaces}" +} + start_service() { [ -s /etc/dropbear/dropbear_rsa_host_key ] || keygen @@ -119,7 +125,21 @@ start_service() service_triggers() { - procd_add_reload_trigger "dropbear" + local interfaces + + procd_open_trigger + procd_add_config_trigger "config.change" "dropbear" /etc/init.d/dropbear reload + + config_load "${NAME}" + config_foreach load_interfaces dropbear + + [ -n "${interfaces}" ] & { + for n in $interfaces ; do + procd_add_interface_trigger "interface.*" $n /etc/init.d/dropbear reload + done + } + procd_close_trigger + procd_add_validation validate_section_dropbear } |