中文交互向导:ssh-tunnel 无参数进入,装完自动进入,填完直接运行

- 向导:选/建主机(实时连通测试,可重试)→ 选/建隧道(端口智能默认)→ 立即前台运行
- install.sh 结尾 exec 进入向导(stdin 从 /dev/tty 读,兼容 curl|bash)
- cli.py 抽出 run_foreground 供 start 与向导复用;修复向导新建隧道分支不可达
This commit is contained in:
leefer
2026-09-27 20:15:21 +08:00
parent 06c57dfbd1
commit 078b272eb1
7 changed files with 270 additions and 29 deletions
+3 -10
View File
@@ -135,14 +135,7 @@ case ":$PATH:" in
;;
esac
say "安装完成!"
say "安装完成!正在进入配置向导 ..."
echo
echo " 配置隧道(示例):"
echo " ssh-tunnel host add 我的服务器 root@1.2.3.4 22"
echo " ssh-tunnel tunnel add web --host 我的服务器 --lp 3000 --rp 3000"
echo " ssh-tunnel start web"
echo
echo " 常用命令: ssh-tunnel list | test <主机> | remove host|tunnel <名称>"
echo " 图形界面(Windows): powershell -c \"irm $BASE_URL/raw/branch/main/install.ps1 | iex\""
echo
[ -n "${ZSH_VERSION:-}${BASH_VERSION:-}" ] || echo "(注:新开终端或 source ~/.bashrc 后 ssh-tunnel 生效)"
# curl|bash 时 stdin 是管道,交互输入从终端(/dev/tty)读
exec "$BIN_DIR/ssh-tunnel" < /dev/tty