From: Stefan Schantl Date: Sun, 6 Sep 2015 16:37:43 +0000 (+0200) Subject: Ensure that radvd is started when needed X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fnetwork.git;a=commitdiff_plain;h=05ab2f8a3bcc1195bd4e7e4ddaf1460a47f9387d Ensure that radvd is started when needed As this is a router we will need to make sure that the router advertisement daemon is running at all times for local zones. This patch will start radvd automatically when ever needed. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.radvd b/src/functions/functions.radvd index 1e84b35f..2079554a 100644 --- a/src/functions/functions.radvd +++ b/src/functions/functions.radvd @@ -25,8 +25,14 @@ radvd_update() { # (Re-)write the configuration file radvd_write_config - # Reload the radvd service. - service_reload radvd + # Reload the radvd service if it is already running + if service_is_active radvd; then + service_reload radvd + return ${EXIT_OK} + fi + + # Start the radvd service + service_start radvd } radvd_write_config() { diff --git a/src/functions/functions.routing b/src/functions/functions.routing index 707e0268..b7b0cc97 100644 --- a/src/functions/functions.routing +++ b/src/functions/functions.routing @@ -80,6 +80,9 @@ routing_default_update() { # Remove too much spaces. routes=$(echo ${routes}) + # Reload radvd configuration + [[ "${proto}" = "ipv6" ]] && radvd_update + # Remove all default routes. if [ -z "${routes}" ]; then cmd ${cmd} del default @@ -92,13 +95,6 @@ routing_default_update() { cmd ${cmd} replace default ${routes} assert [ $? -eq 0 ] - case "${proto}" in - ipv6) - # Apply radvd configuration. - radvd_update - ;; - esac - triggers_execute_all "online" done }