summaryrefslogtreecommitdiffstats
path: root/remote/lib/status.sh
diff options
context:
space:
mode:
Diffstat (limited to 'remote/lib/status.sh')
-rw-r--r--remote/lib/status.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/remote/lib/status.sh b/remote/lib/status.sh
index 644f20a..95e7bbb 100644
--- a/remote/lib/status.sh
+++ b/remote/lib/status.sh
@@ -1,6 +1,7 @@
. lib/parameters.sh
. lib/print.sh
. lib/report.sh
+. lib/run.sh
function check_server_traffic {
local result="$1"
@@ -97,7 +98,7 @@ function check_server_status {
service_status=${BASH_REMATCH[1]}
service_output=$(sed "1 d" <<< "$service_output")
if [ -n "${BASH_REMATCH[2]}" ]; then
- service_header=$(sed -r "s/\\$\{color\s+([^}]*)\}/$(set_color \\1)/g" <<< "${BASH_REMATCH[2]}") #"
+ service_header=$(sed -r "s/\\$\{color\s+([^}]*)\}/\$(set_color \\1)/g" <<< "${BASH_REMATCH[2]}") #"
headers="$headers $service_header"
fi
else
@@ -144,21 +145,21 @@ function check_service {
health=${BASH_REMATCH[2]}
header=${BASH_REMATCH[3]}
- output=$(sed '$ d' <<< $ouput)
+ output=$(sed '$ d' <<< "$output")
fi
print_status "$online"
print_status "$health"
- headers=$(sed -r "s/\\$\{color\s+([^}]*)\}/$(set_color \\1)/g" <<< "$header") # "
- print " ::: ${headers}"
+ header=$(sed -r "s/\\$\{color\s+([^}]*)\}/\$(set_color \\1)/g" <<< "$header") # "
+ print " ::: ${header}"
- important=$(grep "^\*" <<< $output)
- messages=$(grep -v "^\*" <<< $output)
+ important=$(grep "^\*" <<< "$output")
+ messages=$(grep -v "^\*" <<< "$output")
if [ -n "$output" ]; then
- output="\n$(decorate "$service:$id" "cyan" "u")\n$(set_color white)$important\n$(reset_color)$messages\n"
+ output="\n$(decorate "$service:$id" "cyan" "u")\n$important\n$(set_color gray)$messages$(reset_color)\n"
flock -x $0 echo "${output}" >&12
fi
}
@@ -170,7 +171,7 @@ function check__ {
read -ra args <<< "$1" && shift
local host=${args[0]};
- print "$(decorate $title "purple") ::: " | sed -r "s/\\$\{color\s+([^}]*)\}/$(set_color \\1)/g; "
+ print "$(decorate $title "purple") ::: " | sed -r "s/\\$\{color\s+([^}]*)\}/\$(set_color \\1)/g; "
local service
for service in "$@"; do