]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/functions/functions.routing
Merge branch 'master' of git://git.ipfire.org/network
[people/stevee/network.git] / src / functions / functions.routing
index 0674cbd24adfd8faca55505db82c3ccdd0cea23c..707e0268dea4a56f2483bef49e8ce75de051e317 100644 (file)
@@ -81,18 +81,15 @@ routing_default_update() {
                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
@@ -101,17 +98,9 @@ routing_default_update() {
                                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() {
@@ -141,7 +130,7 @@ 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
 }
 
@@ -164,7 +153,7 @@ routing_update() {
        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}