From 5af1b4caa045b6a06f73e5de2be93488c99d240f Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sat, 16 Jul 2022 01:21:00 -0400 Subject: Move the ssh sanity check to the block with the ssh call. --- bin/jupyter_safe_port | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/jupyter_safe_port b/bin/jupyter_safe_port index aa78fb9..8119485 100755 --- a/bin/jupyter_safe_port +++ b/bin/jupyter_safe_port @@ -111,13 +111,13 @@ if [[ $(hostname) =~ $server ]] || [[ $server == "localhost"* ]]; then # Execute the port test script on the local host port_remote=$(next_tcp_port $port_remote_begin $port_remote_end) +else + # Execute the port test script on the remote host + port_remote=$(cat $(which next_tcp_port) | ssh $server "bash -s -- $port_remote_begin $port_remote_end") if (( $? )); then echo "error: $server: connection failed" >&2 exit 1 fi -else - # Execute the port test script on the remote host - port_remote=$(cat $(which next_tcp_port) | ssh $server "bash -s -- $port_remote_begin $port_remote_end") fi port_local=$(next_tcp_port $port_local_begin) -- cgit