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?
if [ "${RC_NOCOLOR}" = "yes" ]; then
- RC_ENDCOL="yes"
-else
RC_ENDCOL="no"
+else
+ RC_ENDCOL="yes"
fi
# Setup COLS and ENDCOL so eend can line up the [ ok ]
}
#}}}
+# 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