Skip to content
Snippets Groups Projects
Commit 5fc2a565 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

remove emoji icons; handle "null" in license info

parent 8969321f
Branches
No related tags found
1 merge request!233Docker checks: remove emoji icons; handle "null" in license info; show rootless or not
......@@ -14,6 +14,7 @@
# 2024-01-18 v1.0 <axel.hahn@unibe.ch> init
# 2024-01-22 v1.1 <axel.hahn@unibe.ch> detect DOCKER; use sudo; add debug
# 2024-01-23 v1.2 <axel.hahn@unibe.ch> Show a list of docker containers; add path
# 2024-01-24 v1.3 <axel.hahn@unibe.ch> remove emoji icons; handle "null" in license info
# ======================================================================
......@@ -117,6 +118,8 @@ iImages=$( _getString "$data" ".Images" )
sVersion=$( _getString "$data" ".ServerVersion")
sLicense=$( _getString "$data" ".ProductLicense" )
test "$sLicense" = "null" && sLicense="no license info"
# --- generate result
if [ "$iCTotal" -eq "0" ]; then
......@@ -159,13 +162,14 @@ if [ $bOptContainers -eq 1 ] && [ "$iCTotal" -gt "0" ]; then
sName=$( _getString "$line" ".Names" )
sState=$( _getString "$line" ".State" )
sStatus=$( _getString "$line" ".Status" )
sIco="🔶"
grep "exited" <<< "${sState}" >/dev/null && sIco="❌"
grep "running" <<< "${sState}" >/dev/null && sIco="✅"
sIco=
# Icinga ui does not show these characters
# sIco="🔶"
# grep "exited" <<< "${sState}" >/dev/null && sIco="❌"
# grep "running" <<< "${sState}" >/dev/null && sIco="✅"
printf " %-14s %-40s %-20s\n" "$sIco $sState" "$sName" "$sStatus"
# echo "$line" | jq
done
echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment