From 1977d21a9bdf95cf2b8f6010b968cf41a317a2ac Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 17 Nov 2025 02:32:14 +0000 Subject: [PATCH] Add interactive testing menu to RDP API installer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- RDP/install-rdp-api.sh | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/RDP/install-rdp-api.sh b/RDP/install-rdp-api.sh index 40af42e..8954313 100755 --- a/RDP/install-rdp-api.sh +++ b/RDP/install-rdp-api.sh @@ -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/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 "" \ No newline at end of file