Fix a bunch of typos
[grml-etc-core.git] / etc / grml / lsb-functions
index 094395a..17a42a3 100644 (file)
@@ -151,7 +151,15 @@ log_end_msg() {
 # initialisation {{{
 # internal variables
 
-# dont output to stdout?
+# Don't output to stdout?
+RC_QUIET_STDOUT="no"
+
+# Default values for e-message indentation and dots
+RC_INDENTATION=''
+RC_DEFAULT_INDENT=2
+#RC_DOT_PATTERN=' .'
+RC_DOT_PATTERN=''
+# don't output to stdout?
 rc_quiet_stdout="no"
 
 # default values for e-message indentation and dots
@@ -166,9 +174,18 @@ if [ -r /proc/cmdline ] ; then
 fi
 [ -n "$NOCOLORS" ] && RC_NOCOLOR='yes'
 RC_NOCOLOR="${RC_NOCOLOR:-no}"
+if [ "$RC_NOCOLOR" = "no" ] ; then
+  if [ -r /etc/grml_colors ] ; then
+    . /etc/grml_colors
+  fi
+fi
 
 # Can the terminal handle endcols?
-RC_ENDCOL="yes"
+if [ "${RC_NOCOLOR}" = "yes" ]; then
+  RC_ENDCOL="no"
+else
+  RC_ENDCOL="yes"
+fi
 
 # Setup COLS and ENDCOL so eend can line up the [ ok ]
 # width of [ ok ] == 7
@@ -396,4 +413,24 @@ ewend() {
 }
 #}}}
 
+# if we're using systemd then redefine functions
+# for output in systemd style
+if [ "$(cat /proc/1/comm 2>/dev/null)" = "systemd" ] ; then
+  einfo() {
+    printf "[  ${GREEN}OK${NORMAL}  ] %s\n" "$*"
+  }
+
+  ewarn() {
+    printf "[ ${YELLOW}WARN${NORMAL} ] %s\n" "$*"
+  }
+
+  eerror() {
+    printf "[ ${RED}FAIL${NORMAL} ] %s\n" "$*"
+  }
+
+  eend() {
+    :
+  }
+fi
+
 # vim: ft=sh tw=80 ts=4 foldmethod=marker