Add interactive testing menu to RDP API installer

Add post-installation testing menu with options to:
1) Test RDP mode activation
2) Test Shell mode activation
3) Skip testing

This allows users to immediately test API functionality after installation
without manually typing curl commands. The menu uses the installed API
to toggle modes and displays current status after each action.

🤖 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 02:32:14 +00:00
parent 2bf3754d62
commit 1977d21a9b

View File

@ -110,4 +110,61 @@ echo "🔧 서비스 관리:"
echo " systemctl status rdp-toggle-api"
echo " systemctl restart rdp-toggle-api"
echo " systemctl stop rdp-toggle-api"
echo ""
# 테스트 메뉴 제공
echo "=========================================="
echo "RDP API를 테스트하시겠습니까?"
echo " 1) RDP 모드로 전환 테스트"
echo " 2) Shell 모드로 전환 테스트"
echo " 3) 건너뛰기"
echo ""
echo -n "선택 [1/2/3]: "
read -r test_choice </dev/tty
case "$test_choice" in
1)
echo ""
echo "RDP 모드로 전환 중..."
if curl -s -X POST http://localhost:8090/toggle \
-H 'Content-Type: application/json' \
-d '{"mode":"rdp"}' > /dev/null 2>&1; then
echo "✅ RDP 모드로 전환 완료!"
echo ""
echo "현재 상태:"
curl -s http://localhost:8090/status | python3 -m json.tool 2>/dev/null || curl -s http://localhost:8090/status
else
echo "❌ RDP 모드 전환 실패. 서비스 상태를 확인하세요:"
echo " systemctl status rdp-toggle-api"
fi
;;
2)
echo ""
echo "Shell 모드로 전환 중..."
if curl -s -X POST http://localhost:8090/toggle \
-H 'Content-Type: application/json' \
-d '{"mode":"shell"}' > /dev/null 2>&1; then
echo "✅ Shell 모드로 전환 완료!"
echo ""
echo "현재 상태:"
curl -s http://localhost:8090/status | python3 -m json.tool 2>/dev/null || curl -s http://localhost:8090/status
else
echo "❌ Shell 모드 전환 실패. 서비스 상태를 확인하세요:"
echo " systemctl status rdp-toggle-api"
fi
;;
3)
echo ""
echo "테스트를 건너뜁니다."
;;
*)
echo ""
echo "잘못된 선택입니다. 테스트를 건너뜁니다."
;;
esac
echo ""
echo "=========================================="
echo "설치 및 설정이 완료되었습니다!"
echo "=========================================="
echo ""