From: Michael Tremer Date: Sat, 10 Jul 2010 17:37:43 +0000 (+0200) Subject: network: Add some initialization handlers. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dd7fd6c8d422b89a2a81cc0b4da6af8a2854dc5;p=ipfire-3.x.git network: Add some initialization handlers. --- diff --git a/pkgs/core/network/src/functions b/pkgs/core/network/src/functions index c67944810..89a4ed023 100644 --- a/pkgs/core/network/src/functions +++ b/pkgs/core/network/src/functions @@ -1,5 +1,18 @@ #!/bin/bash +INIT_FUNCTIONS="" + +function init_register() { + INIT_FUNCTIONS="${INIT_FUNCTIONS} $@" +} + +function init_run() { + local init + for init in ${INIT_FUNCTIONS}; do + ${init} + done +} + for file in /lib/network/functions.*; do . ${file} done @@ -27,3 +40,7 @@ case "${COLOURS}" in warning_log "Unknown parameter given for COLOURS: ${COLOURS}" ;; esac + +if [ "$(basename ${0})" = "network" ]; then + init_run +fi