]> git.ipfire.org Git - people/stevee/network.git/blob - functions
Merge remote-tracking branch 'stevee/UsrMove'
[people/stevee/network.git] / functions
1 #!/bin/bash
2
3 # Make sure, that sbins are in PATH.
4 export PATH="/usr/local/sbin:/usr/sbin:/sbin:/bin:/usr/bin"
5
6 INIT_FUNCTIONS=""
7
8 function init_register() {
9 INIT_FUNCTIONS="${INIT_FUNCTIONS} $@"
10 }
11
12 function init_run() {
13 local init
14 for init in ${INIT_FUNCTIONS}; do
15 ${init}
16 done
17 }
18
19 # Include version information.
20 . /usr/lib/network/version
21
22 for file in /usr/lib/network/functions.*; do
23 . ${file}
24 done
25
26 # Reading in network tool configuration
27 network_config_read
28
29 # Create run dir
30 if ! [ -d "${RUN_DIR}" ]; then
31 mkdir ${RUN_DIR}
32 fi
33
34 # Set colour mode
35 case "${COLOURS}" in
36 auto)
37 colours_auto_disable
38 ;;
39 off|0)
40 colours_disable
41 ;;
42 on|1)
43 # Do nothing
44 ;;
45 *)
46 warning_log "Unknown parameter given for COLOURS: ${COLOURS}"
47 ;;
48 esac
49