explore_nginx.sh 624 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. SERVER_IP="47.253.147.187"
  3. SERVER_USER="root"
  4. SERVER_PASS="5H0FuZ:2s0q)Lx"
  5. /usr/bin/expect <<EOF
  6. set timeout 30
  7. spawn ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP
  8. expect {
  9. "password:" { send "$SERVER_PASS\r" }
  10. "yes/no" { send "yes\r"; exp_continue }
  11. }
  12. expect "#"
  13. send "ls -F /www/server/nginx/conf/\r"
  14. send "ls -F /www/server/nginx/conf/vhost/\r"
  15. send "ls -F /www/server/panel/vhost/nginx/ 2>/dev/null\r"
  16. send "echo '--- EXISTING CERTS ---'\r"
  17. send "find /www/server -name '*.pem' -o -name '*.crt' | head -n 10\r"
  18. send "cat /www/server/nginx/conf/nginx.conf\r"
  19. send "exit\r"
  20. expect eof
  21. EOF