Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Admin9705 committed Sep 18, 2024
1 parent 8dac1db commit 96ffbd8
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions mods/scripts/apps/interface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down

0 comments on commit 96ffbd8

Please sign in to comment.