From 96ffbd816c0070d3822564638b11bb203c61b598 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Tue, 17 Sep 2024 21:03:22 -0400 Subject: [PATCH] update --- mods/scripts/apps/interface.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/mods/scripts/apps/interface.sh b/mods/scripts/apps/interface.sh index 684a0d0d7..472b64c43 100644 --- a/mods/scripts/apps/interface.sh +++ b/mods/scripts/apps/interface.sh @@ -17,7 +17,7 @@ config_type=$2 # 'personal' for personal configurations, 'official' for officia # Function: check_deployment_status check_deployment_status() { - # Load the configuration file to get the port_number + # Load the configuration file to get the port_number and expose value if [[ "$config_type" == "personal" ]]; then config_file="/pg/personal_configs/${app_name}.cfg" else @@ -28,12 +28,25 @@ check_deployment_status() { source "$config_file" fi + # Determine port status based on the 'expose' variable + if [[ "$expose" == "127.0.0.1"* ]]; then + port_status="Closed" + else + port_status="Open" + fi + + # Check if the app's Docker container is running local container_status=$(docker ps --filter "name=^/${app_name}$" --format "{{.Names}}") if [[ "$container_status" == "$app_name" ]]; then - echo -e "${GREEN}[Deployed]${NC} $app_name - Port: $port_number" + echo -e "${GREEN}[Deployed]${NC} $app_name - Port: $port_number/$port_status" else - echo -e "${RED}[Not Deployed]${NC} $app_name" + # App is not deployed, show potential port status if deployed + if [[ "$port_status" == "Closed" ]]; then + echo -e "${RED}[Not Deployed]${NC} $app_name - Port Closed if Deployed" + else + echo -e "${RED}[Not Deployed]${NC} $app_name - Port Open if Deployed" + fi fi }