Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ case "$command" in
;;
esac

# At this point all of the commands we might run need to SSH. Only the "run"
# command passes files, so for the "sem" etc we can just ssh to tftp, and rerun
# the full mq.sh script. This uses only 1 SSH connection.
if [ "$(hostname -f)" != "${HOST}" ] && [ "$command" != "run" ]; then
RemoteExec mq.sh "$command" "$@"
exit $?
fi


# Check we can talk to the cannonical host
if ! RemoteCommand exit; then
Expand Down
7 changes: 7 additions & 0 deletions scripts/remote
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ RemoteCommand() {
fi
RemoteCommandOn "${HOST}" "$@"
}

# Like RemoteCommand, but doesn't run "stty" to change echo behaviour
# Needs -tt for pseudo-tty so that Ctrl+C interrupts are forwarded to
# bash on the remote end.
RemoteExec() {
ssh -tt -oLogLevel=quiet "${HOST}" "$@"
}
Loading