Update mw.tpl

This commit is contained in:
dami 2026-02-01 03:47:15 +08:00
parent c4bffbda11
commit 691b4b5e59
1 changed files with 1 additions and 4 deletions

View File

@ -642,10 +642,7 @@ mw_ssh(){
# SSS="127.0.0.1|22|root|xx"
IFS='|' read -r SERVER_IP SERVER_PORT SERVER_USER SERVER_PASS <<< "$SSS"
echo "Attempting SSH connection to $SERVER_USER@$SERVER_IP:$SERVER_PORT"
if ! sshpass -p "$SERVER_PASS" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 -p "$SERVER_PORT" "$SERVER_USER@$SERVER_IP" "echo 'SSH connection successful'"; then
echo "SSH connection failed to $SERVER_USER@$SERVER_IP:$SERVER_PORT"
return 1
fi
sshpass -p "$SERVER_PASS" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=10 -p "$SERVER_PORT" "$SERVER_USER@$SERVER_IP"
fi
}