]> git.ipfire.org Git - people/jschlag/network.git/commitdiff
Remove registration of functions called on init
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 15 Aug 2018 09:26:51 +0000 (10:26 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 15 Aug 2018 09:26:51 +0000 (10:26 +0100)
Only one function used this and it was slow since it got initialised
every time the functions were loaded.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.dns
src/functions/functions.in
src/network

index f9483eeaa6be0bdf5a345202d9a821ba783560cb..4cd5cb4c04ffa5cf6a97a9baeb708de359260881 100644 (file)
@@ -238,9 +238,6 @@ dns_server_update() {
        radvd_update
 }
 
-# Update resolv.conf(5) when initializing the network.
-init_register dns_generate_resolvconf
-
 dns_generate_resolvconf() {
        local file=${RESOLV_CONF}
 
index 15e3531f31b956f2f24a5eb1bf635bee9269466d..927d18d519e32fe84d1de937cec29fc1879233d2 100644 (file)
 # PATH variable.
 export PATH="@utildir@:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin:/bin:${PATH}"
 
-INIT_FUNCTIONS=""
-
-init_register() {
-       INIT_FUNCTIONS="${INIT_FUNCTIONS} $@"
-}
-
-init_run() {
-       local init
-       for init in ${INIT_FUNCTIONS}; do
-               ${init}
-       done
-
-       # Also execute all triggers
-       triggers_execute_all "init"
-}
-
 VERSION="@PACKAGE_VERSION@"
 NETWORK_VERSION="${VERSION}"
 
index f26c0dc0ecf5ae7cb056e40e4b78ee9d868993f5..cc6a07ed5031e1484fa993aad8681893dc3e8c28 100644 (file)
@@ -1181,9 +1181,6 @@ cli_reset() {
        # Flush all DNS servers.
        dns_server_flush
 
-       # Re-run the initialization functions
-       init_run
-
        exit ${EXIT_OK}
 }
 
@@ -1367,7 +1364,11 @@ cli_raw() {
 # Process the given action
 case "${action}" in
        init)
-               init_run
+               # Update resolv.conf(5) when initializing the network
+               dns_generate_resolvconf
+
+               # Also execute all triggers
+               triggers_execute_all "init"
                ;;
 
        settings|hostname|port|device|zone|start|stop|restart|status|reset|route|vpn|wireless)