From: Michael Tremer Date: Sat, 10 Jul 2010 17:37:43 +0000 (+0200) Subject: network: Add some initialization handlers. X-Git-Tag: 001~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d632ad448f715a7743448b9a1b43a08949adb9b;p=network.git network: Add some initialization handlers. --- diff --git a/functions b/functions index c6794481..89a4ed02 100644 --- a/functions +++ b/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