From 4d1845c6bc2e0d60967a210a220d37e04c0ecc77 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 8 Apr 2026 13:26:56 +0000 Subject: [PATCH] =?UTF-8?q?Phase=205/6=20=EC=8A=A4=ED=82=B5=20=EA=B0=90?= =?UTF-8?q?=EC=A7=80=20=EC=95=88=EC=A0=95=ED=99=94:=20set=20-e=20=EC=B6=A9?= =?UTF-8?q?=EB=8F=8C=20=EB=B0=A9=EC=A7=80=20+=20grep=20-P=20=ED=98=B8?= =?UTF-8?q?=ED=99=98=EC=84=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ct_exec 실패 시 || true로 스크립트 종료 방지 - grep -oP → sed로 변경 (Debian/PVE 호환) Co-Authored-By: Claude Opus 4.6 (1M context) --- pharmq-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) — 스킵"