From 4e99cc15809a2125153701dda95d6647d38d1a8b Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Sat, 21 Jun 2025 05:08:19 +0800 Subject: [PATCH] feat(riot): sshd can specify the local port --- scripts/riot | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/riot b/scripts/riot index 78ea960..6465831 100755 --- a/scripts/riot +++ b/scripts/riot @@ -190,12 +190,12 @@ run_sshl() # sshd run_sshd() { - local port=$(get_free_port) + local port=${1:-$(get_free_port)} SSH_OPTIONS+=("-NC" "-D" "$port") prepare_ssh_cmd ssh fmt_note "-->" "${CMD[@]}" fmt_note " > please access localhost:$port" - eval_or_echo $cmd + eval_or_echo } # scp @@ -251,12 +251,13 @@ print_help() fmt_info "usage: $0 [-Ddhlqt] [--dry-run] [--dev] [--help] [--lite] [--quite] [--trust] [--tmux] [--password] [[-o ssh-option]...] remote [command] [--] [ssh-command-args]" cat <