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 <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# (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() {
# 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
cmd ${cmd} replace default ${routes}
assert [ $? -eq 0 ]
- case "${proto}" in
- ipv6)
- # Apply radvd configuration.
- radvd_update
- ;;
- esac
-
triggers_execute_all "online"
done
}