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

show rootless or not

parent a808b8d0
No related branches found
No related tags found
1 merge request!233Docker checks: remove emoji icons; handle "null" in license info; show rootless or not
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# 2024-01-18 v1.0 <axel.hahn@unibe.ch> init # 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-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-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 # 2024-01-24 v1.3 <axel.hahn@unibe.ch> remove emoji icons; handle "null" in license info; show rootless or not
# ====================================================================== # ======================================================================
...@@ -118,7 +118,6 @@ iImages=$( _getString "$data" ".Images" ) ...@@ -118,7 +118,6 @@ iImages=$( _getString "$data" ".Images" )
sVersion=$( _getString "$data" ".ServerVersion") sVersion=$( _getString "$data" ".ServerVersion")
sLicense=$( _getString "$data" ".ProductLicense" ) sLicense=$( _getString "$data" ".ProductLicense" )
test "$sLicense" = "null" && sLicense="no license info"
# --- generate result # --- generate result
...@@ -151,7 +150,15 @@ ph.perfadd "images" "$iImages" ...@@ -151,7 +150,15 @@ ph.perfadd "images" "$iImages"
# --- output # --- output
ph.status "Docker $sVersion ($sLicense) .. containers: $iCTotal running: $iCRunning paused: $iCPaused stopped: $iCStopped .. images: $iImages" sStatus="Docker $sVersion ("
test -n "$sLicense" && sStatus+="$sLicense, "
test "$_is_docker_rootless" -eq "0" && sStatus+="as root"
test "$_is_docker_rootless" -eq "1" && sStatus+="rootless"
sStatus+=") .. "
sStatus+="containers: $iCTotal running: $iCRunning paused: $iCPaused stopped: $iCStopped .. "
sStatus+="images: $iImages"
ph.status "$sStatus"
echo "$out" echo "$out"
if [ $bOptContainers -eq 1 ] && [ "$iCTotal" -gt "0" ]; then if [ $bOptContainers -eq 1 ] && [ "$iCTotal" -gt "0" ]; then
...@@ -176,7 +183,7 @@ if [ $bOptContainers -eq 1 ] && [ "$iCTotal" -gt "0" ]; then ...@@ -176,7 +183,7 @@ if [ $bOptContainers -eq 1 ] && [ "$iCTotal" -gt "0" ]; then
fi fi
# if -d was given then show debug infos too # if -d was given then show debug infos too
test $bOptDebug -eq 1 && ( echo; echo "DEBUG: full docker system infos as json"; echo "$data" | jq ) test $bOptDebug -eq 1 && ( echo; echo "DEBUG: full docker system infos as json"; echo "$data" | jq ; _debugInfos)
ph.exit ph.exit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment