diff options
author | Thibaut VARÈNE <hacks@slashdirt.org> | 2022-01-27 11:28:15 +0100 |
---|---|---|
committer | Rosen Penev <rosenp@gmail.com> | 2022-01-29 21:02:28 -0800 |
commit | 06193dfdd6b3781f14afada30faa8952558d00b6 (patch) | |
tree | 4a5f12486decb885908dbd293fa11c11d99b2d2c /net/coova-chilli/files | |
parent | cf668471c7ca5f2e687f58a34bf438c72d622c06 (diff) |
coova-chilli: postpone startup until wan is available
Coova Chilli will fail to start if e.g. it cannot resolve names in its
configuration (like uamserver, radiusserver, etc) which is typically the
case when wan is unavailable. Prevent this situation by delaying startup
if wan is not available.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Diffstat (limited to 'net/coova-chilli/files')
-rw-r--r-- | net/coova-chilli/files/chilli.init | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/net/coova-chilli/files/chilli.init b/net/coova-chilli/files/chilli.init index ab6ce7130..1c163a0d6 100644 --- a/net/coova-chilli/files/chilli.init +++ b/net/coova-chilli/files/chilli.init @@ -52,19 +52,24 @@ start_chilli() { config_get_bool disabled "$1" 'disabled' 0 [ $disabled = 1 ] && return - procd_open_instance "$cfg" - procd_set_param command /usr/sbin/chilli - procd_set_param file "$chilli_conf" - procd_append_param command \ - --fg \ - --conf "${base}.conf" \ - --pidfile "${base}.pid" \ - --cmdsocket "${base}.sock" \ - --unixipc "${base}.ipc" - procd_set_param respawn - procd_set_param stdout 1 - procd_set_param stderr 1 - procd_close_instance + . /lib/functions/network.sh + + local wanif ipaddr + if network_find_wan wanif && network_get_ipaddr ipaddr "$wanif"; then + procd_open_instance "$cfg" + procd_set_param command /usr/sbin/chilli + procd_set_param file "$chilli_conf" + procd_append_param command \ + --fg \ + --conf "${base}.conf" \ + --pidfile "${base}.pid" \ + --cmdsocket "${base}.sock" \ + --unixipc "${base}.ipc" + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance + fi } start_service() { |