]> git.ipfire.org Git - network.git/commitdiff
network: Add some initialization handlers.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 10 Jul 2010 17:37:43 +0000 (19:37 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 10 Jul 2010 17:37:43 +0000 (19:37 +0200)
functions

index c679448103a419a2b9d7048ea42689ffb960ed54..89a4ed02345c55d3408ff7d15bfbee838c9b6587 100644 (file)
--- 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