+#!/bin/sh
+
+if [ "$USE_COLOR" = '1' ] && [ -x /usr/bin/tput ]; then
+red=$(tput setaf 1)
+green=$(tput setaf 2)
+off=$(tput sgr0)
+fi
+
+status_msg() {
+ echo "\r[$1]"
+}
+
status_starting() {
echo -n "[ ] Starting $1"
}
}
status_ok() {
- echo "\r[ OK ]"
+ echo "\r[ ${green}OK$off ]"
}
status_fail() {
}
status_check() {
- local r=$1
- test ${r:=$?} -eq 0 && status_ok || status_fail
+ test $? -eq 0 && status_ok || status_fail
+}
+
+is_true() {
+ [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || [ "$1" = "y" ] ||
+ [ "$1" = "t" ]
}