#!/bin/bash

# Get ports allocated to specific service
portGetServicePorts()
{
    local app_name="$1"
    local service_name="${2:-main}"
    
    local sql="SELECT resource_value FROM network_resources 
              WHERE app_name='$app_name' AND resource_type='port' AND service_name='$service_name' AND status='active';"
    local result=$(sqlite3 "$docker_dir/$db_file" "$sql" 2>/dev/null)
    
    service_ports="$result"
}
