#!/bin/bash # Test script for full auto-login with SMS echo "🚀 Testing Full Auto-Login with SMS Forwarding" echo "" # Check SMS receiver is running echo "1. Checking SMS Receiver..." SMS_STATUS=$(curl -s http://localhost:4417/health 2>/dev/null) if [ $? -eq 0 ]; then echo " ✅ SMS Receiver running" else echo " ❌ SMS Receiver not running - starting..." cd /home/debian/videotomp3transcriptor node src/sms_receiver.js & sleep 3 fi echo "" echo "2. Testing SMS endpoint..." curl -s -X POST http://localhost:4417/sms \ -H "Content-Type: application/json" \ -d '{"from":"Test","body":"Test code 999999"}' > /dev/null CODE=$(curl -s http://localhost:4417/sms/code | grep -o '"code":"[0-9]*"' | cut -d'"' -f4) if [ "$CODE" = "999999" ]; then echo " ✅ SMS endpoint working (code: $CODE)" else echo " ❌ SMS endpoint error" exit 1 fi echo "" echo "3. Ready to test auto-login!" echo "" echo " Run: export DISPLAY=:99" echo " Run: cd /home/debian/videotomp3transcriptor" echo " Run: python3 src/python/auto_login_full_auto.py" echo "" echo " The script will:" echo " - Navigate to Google login" echo " - Enter email & phone" echo " - WAIT for SMS (you'll receive on phone)" echo " - SMS Forwarder sends to server" echo " - Script reads code automatically" echo " - Completes login!" echo "" echo "📱 Make sure SMS Forwarder is configured and running!"