🔨 added statuscheck #2

Merged
benji merged 1 commit from DEV into main 2026-08-15 21:13:43 +00:00
2 changed files with 27 additions and 0 deletions
Showing only changes of commit b559f5d3a8 - Show all commits

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -0,0 +1,27 @@
printf "%-25s | %-35s | %-10s\n" "ORDNER" "URL" "STATUS"
printf "%s\n" "--------------------------------------------------------------------------------"
for dir in */; do
env_file="${dir}.env"
compose_file="${dir}docker-compose.yml"
if [ -f "$env_file" ] && [ -f "$compose_file" ]; then
sub=$(grep '^SUBDOMAIN=' "$env_file" | cut -d'=' -f2-)
domain=$(grep '^DOMAIN=' "$env_file" | cut -d'=' -f2-)
cname=$(grep '^CONTAINER_NAME=' "$env_file" | cut -d'=' -f2-)
if [ -n "$sub" ] && [ -n "$domain" ]; then
url="${sub}.${domain}"
else
url="${domain:-N/A}"
fi
status="STOPPED"
if [ -n "$cname" ] && [ "$(docker ps -q -f name="^${cname}$")" ]; then
status="RUNNING"
elif [ "$(docker compose -f "$compose_file" ps --status running -q 2>/dev/null)" ]; then
status="RUNNING"
fi
printf "%-25s | https://%-33s | %-10s\n" "${dir%/}" "$url" "$status"
fi
done