diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2016-04-27 11:14:00 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2016-04-28 13:49:37 +0200 |
commit | 16122117a5fb376bd5d5ed905a5eea9076d54b04 (patch) | |
tree | c675ef7d51184108122b889d5cd9cafd1b284b18 /package/network/services/dropbear/files | |
parent | b3f6c4b3acf169beb907b1eede4084ea69f24770 (diff) | |
download | upstream-16122117a5fb376bd5d5ed905a5eea9076d54b04.tar.gz upstream-16122117a5fb376bd5d5ed905a5eea9076d54b04.tar.bz2 upstream-16122117a5fb376bd5d5ed905a5eea9076d54b04.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>
Diffstat (limited to 'package/network/services/dropbear/files')
-rwxr-xr-x | package/network/services/dropbear/files/dropbear.init | 22 |
1 files changed, 21 insertions, 1 deletions
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 } |