diff --git a/pharmq-setup.sh b/pharmq-setup.sh index 99e461f..5ecf4b5 100644 --- a/pharmq-setup.sh +++ b/pharmq-setup.sh @@ -596,7 +596,7 @@ phase5_create_ct() { ct_hostname=$(pct config "$vmid" 2>/dev/null | grep "^hostname:" | awk '{print $2}') if [ "$ct_hostname" = "ubuntu-api" ]; then CT_VMID="$vmid" - CT_LAN_IP=$(pct config "$vmid" 2>/dev/null | grep "^net0:" | grep -oP 'ip=\K[^/]+') + CT_LAN_IP=$(pct config "$vmid" 2>/dev/null | grep "^net0:" | sed 's/.*ip=\([^/]*\).*/\1/' || true) print_ok "CT $CT_VMID (ubuntu-api) 이미 존재 — 생성 스킵" # CT가 꺼져있으면 시작 if pct status "$vmid" 2>/dev/null | grep -q "stopped"; then @@ -693,8 +693,8 @@ phase6_setup_ct() { } # 이미 CT에 Tailscale이 등록되어있고 API 코드가 있으면 스킵 - local existing_vpn - existing_vpn=$(ct_exec "tailscale ip -4 2>/dev/null" 2>/dev/null | tr -d '[:space:]') + local existing_vpn="" + existing_vpn=$(ct_exec "tailscale ip -4 2>/dev/null" 2>/dev/null | tr -d '[:space:]' || true) if [ -n "$existing_vpn" ] && ct_exec "test -d /srv/person-lookup-web-local" 2>/dev/null; then CT_VPN_IP="$existing_vpn" print_ok "CT 환경 이미 구축됨 (VPN: $CT_VPN_IP) — 스킵"