RDP 초기 설정 스크립트 버전 체크 로직 개선

- Proxmox 버전 확인 시 에러 처리 강화
- pveversion 명령 출력 형식 다양하게 지원
- 버전 확인 실패 시 경고 후 계속 진행
- 정규표현식으로 버전 번호 추출 개선
- 숫자 검증 로직 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude 2025-11-17 00:53:11 +00:00
parent 4934b0a8f9
commit d0c8b26138

View File

@ -49,14 +49,25 @@ print_header() {
check_proxmox_version() {
msg_info "Proxmox VE 버전 확인 중..."
if [ ! -f /etc/pve/.version ]; then
msg_error "Proxmox VE가 설치되어 있지 않습니다."
# pveversion 명령어 확인
if ! command -v pveversion > /dev/null 2>&1; then
msg_warn "pveversion 명령을 찾을 수 없습니다. 버전 확인을 건너뜁니다."
return 0
fi
local pve_version=$(pveversion | head -n1 | awk '{print $2}' | cut -d'.' -f1)
# 버전 추출 (여러 형식 지원)
local pve_version=$(pveversion 2>/dev/null | head -n1 | grep -oP '\d+\.\d+' | head -n1 | cut -d'.' -f1)
if [ "$pve_version" -lt 8 ]; then
msg_error "지원되지 않는 Proxmox VE 버전입니다. 8.x 이상이 필요합니다."
# 버전 번호를 추출할 수 없으면 경고만 하고 계속 진행
if [ -z "$pve_version" ]; then
msg_warn "Proxmox VE 버전을 확인할 수 없습니다. 계속 진행합니다."
return 0
fi
# 숫자인지 확인
if ! [[ "$pve_version" =~ ^[0-9]+$ ]]; then
msg_warn "Proxmox VE 버전 형식이 올바르지 않습니다 ($pve_version). 계속 진행합니다."
return 0
fi
msg_ok "Proxmox VE $pve_version.x 버전 확인됨"