#!/bin/bash # Runs a command in the test VM: tests/vssh.sh team|icpc 'command' # Passwords: TEAM_PASS (default contest) and ADMIN_PASS (password given to build.sh). user=$1; shift case "$user" in team) pass=${TEAM_PASS:-contest} ;; icpc) pass=${ADMIN_PASS:?set ADMIN_PASS to the administrator password} ;; *) echo "user must be team or icpc" >&2; exit 2 ;; esac exec sshpass -p "$pass" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ -o LogLevel=ERROR -o ConnectTimeout=5 -p 2222 "$user@127.0.0.1" "$@"