mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:29:26 +08:00
Update mw.tpl
This commit is contained in:
@@ -641,7 +641,11 @@ mw_ssh(){
|
||||
# echo "info:$SSS"
|
||||
# SSS="127.0.0.1|22|root|xx"
|
||||
IFS='|' read -r SERVER_IP SERVER_PORT SERVER_USER SERVER_PASS <<< "$SSS"
|
||||
sshpass -p "$SERVER_PASS" ssh -p "$SERVER_PORT" "$SERVER_IP"
|
||||
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
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user