aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-11-10 19:18:27 -0500
committerDave Reisner <dreisner@archlinux.org>2011-11-10 19:18:27 -0500
commitcd9fd2a7ccb7a47e7c76914045705cf1304ca929 (patch)
treec93ed0b733192fde2dff6258004d08a0387ecb58
parentf57463b27ed1d17cc2dcbf6a9bdbaa3d6fe4edb8 (diff)
downloadinitscripts-2011.11.2.tar.xz
functions: move all logic to the end of the file2011.11.2
...where it belongs Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--functions82
1 files changed, 41 insertions, 41 deletions
diff --git a/functions b/functions
index 6cec95b..8218d68 100644
--- a/functions
+++ b/functions
@@ -122,47 +122,6 @@ parse_envfile() {
return $ret
}
-if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then
- LANG=${LOCALE:-C}
- if [[ -r /etc/locale.conf ]]; then
- parse_envfile /etc/locale.conf "${localevars[@]}"
- fi
-else
- export LANG=C
-fi
-
-# set colors
-if [[ $USECOLOR = [yY][eE][sS] ]]; then
- if tput setaf 0 &>/dev/null; then
- C_CLEAR=$(tput sgr0) # clear text
- C_MAIN=${C_CLEAR}$(tput bold) # main text
- C_OTHER=${C_MAIN}$(tput setaf 4) # prefix & brackets
- C_SEPARATOR=${C_MAIN}$(tput setaf 0) # separator
- C_BUSY=${C_CLEAR}$(tput setaf 6) # busy
- C_FAIL=${C_MAIN}$(tput setaf 1) # failed
- C_DONE=${C_MAIN} # completed
- C_BKGD=${C_MAIN}$(tput setaf 5) # backgrounded
- C_H1=${C_MAIN} # highlight text 1
- C_H2=${C_MAIN}$(tput setaf 6) # highlight text 2
- else
- C_CLEAR="\e[m" # clear text
- C_MAIN="\e[;1m" # main text
- C_OTHER="\e[1;34m" # prefix & brackets
- C_SEPARATOR="\e[1;30m" # separator
- C_BUSY="\e[;36m" # busy
- C_FAIL="\e[1;31m" # failed
- C_DONE=${C_MAIN} # completed
- C_BKGD="\e[1;35m" # backgrounded
- C_H1=${C_MAIN} # highlight text 1
- C_H2="\e[1;36m" # highlight text 2
- fi
-fi
-
-# prefixes:
-
-PREFIX_REG="::"
-PREFIX_HL=" >"
-
# functions:
deltext() {
@@ -641,6 +600,47 @@ EOF
fi
}
+if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then
+ LANG=${LOCALE:-C}
+ if [[ -r /etc/locale.conf ]]; then
+ parse_envfile /etc/locale.conf "${localevars[@]}"
+ fi
+else
+ export LANG=C
+fi
+
+# set colors
+if [[ $USECOLOR = [yY][eE][sS] ]]; then
+ if tput setaf 0 &>/dev/null; then
+ C_CLEAR=$(tput sgr0) # clear text
+ C_MAIN=${C_CLEAR}$(tput bold) # main text
+ C_OTHER=${C_MAIN}$(tput setaf 4) # prefix & brackets
+ C_SEPARATOR=${C_MAIN}$(tput setaf 0) # separator
+ C_BUSY=${C_CLEAR}$(tput setaf 6) # busy
+ C_FAIL=${C_MAIN}$(tput setaf 1) # failed
+ C_DONE=${C_MAIN} # completed
+ C_BKGD=${C_MAIN}$(tput setaf 5) # backgrounded
+ C_H1=${C_MAIN} # highlight text 1
+ C_H2=${C_MAIN}$(tput setaf 6) # highlight text 2
+ else
+ C_CLEAR="\e[m" # clear text
+ C_MAIN="\e[;1m" # main text
+ C_OTHER="\e[1;34m" # prefix & brackets
+ C_SEPARATOR="\e[1;30m" # separator
+ C_BUSY="\e[;36m" # busy
+ C_FAIL="\e[1;31m" # failed
+ C_DONE=${C_MAIN} # completed
+ C_BKGD="\e[1;35m" # backgrounded
+ C_H1=${C_MAIN} # highlight text 1
+ C_H2="\e[1;36m" # highlight text 2
+ fi
+fi
+
+# prefixes:
+
+PREFIX_REG="::"
+PREFIX_HL=" >"
+
# Source additional functions at the end to allow overrides
for f in /etc/rc.d/functions.d/*; do
[[ -e $f ]] && . "$f"