routes=$(echo ${routes})
# Remove all default routes.
- while ${cmd} | grep -q "^default"; do
- ${cmd} del default
- done
-
if [ -z "${routes}" ]; then
+ cmd ${cmd} del default
log INFO "Removed default route for ${proto}."
return ${EXIT_OK}
fi
log INFO "Setting default route for ${proto}: ${routes}"
- cmd ${cmd} add default ${routes}
+ cmd ${cmd} replace default ${routes}
assert [ $? -eq 0 ]
case "${proto}" in
radvd_update
;;
esac
- done
-}
-# XXX deprecated function
-routing_table_exists() {
- route_table_exists $@
-}
-
-# XXX deprecated function
-routing_table_create() {
- route_table_create $@
+ triggers_execute_all "online"
+ done
}
routing_db_from_ppp() {
# Save the MAC address of the remote DSLAM
if isset PPP_MACREMOTE; then
- db_set "${zone}/${proto}/remote-address" "${PPP_MACREMOTE,,}"
+ db_set "${zone}/remote-address" "${PPP_MACREMOTE,,}"
fi
}
fi
# Create routing table if not exists
- routing_table_create ${table}
+ route_table_create ${table}
log DEBUG "Flushing routing table ${table}"
cmd ${ip_cmd} route flush table ${table}