aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/jupyter_safe_port6
1 files 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)