diff --git a/README.en.md b/README.en.md
index 0cb63d6..b89d268 100644
--- a/README.en.md
+++ b/README.en.md
@@ -181,7 +181,7 @@ bash reinstall.sh anolis 7|8|23
- `--ssh-key KEY` Set up SSH login public key, [formatted as follows](#--ssh-key). When using public key, password is empty.
- `--ssh-port PORT` Change the SSH port (for log observation during installation and for the new system)
- `--web-port PORT` Change the Web port (for log observation during installation only)
-- `--frpc-toml PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL
+- `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file.
- `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection.
- `--hold 2` Prevent reboot after installation completes, allowing SSH login to modify system content; the system is mounted at `/target` for Debian/Kali and `/os` for other distros.
@@ -247,7 +247,7 @@ bash reinstall.sh dd --img "https://example.com/xxx.xz"
- `--rdp-port PORT` Change RDP port (DD Windows only)
- `--ssh-port PORT` Change SSH port (for log observation during installation)
- `--web-port PORT` Change Web port (for log observation during installation)
-- `--frpc-toml PATH` Add frpc for intranet tunneling (DD Windows only). Parameter can be local filepath or HTTP URL
+- `--frpc-config PATH` Add frpc for intranet tunneling (DD Windows only). Parameter can be local filepath or HTTP URL of the configuration file.
- `--cloud-data PATH_OR_URL` Inject cloud-init NoCloud configuration into the DD'd Linux image (DD Linux only)
- `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection.
- `--hold 2` Prevent reboot after the DD process finishes. For SSH login to modify system content. The Windows system will be mounted at `/os`, but Linux systems will **NOT** be automatically mounted.
@@ -298,7 +298,7 @@ bash reinstall.sh alpine --hold 1
- `--password PASSWORD` Set password
- `--ssh-port PORT` Change SSH port
- `--ssh-key KEY` Set up SSH login public key, [formatted as follows](#--ssh-key). When using public key, password is empty.
-- `--frpc-toml PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL
+- `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file.
### Feature 4: Reboot to
netboot.xyz
@@ -453,7 +453,7 @@ bash reinstall.sh windows \
- `--add-driver INF_OR_DIR` Add additional driver, specifying .inf path, or the folder contains .inf file.
- The driver must be downloaded to current system first.
- This parameter can be set multiple times to add different driver.
-- `--frpc-toml PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL
+- `--frpc-config PATH` Add frpc for intranet tunneling. Parameter can be local filepath or HTTP URL of the configuration file.
- `--hold 1` Reboot only into install environment, without running installer, only for SSH connect to test network connection.
- `--hold 2` Allow SSH connections for modifying `boot.wim`, `install.wim` or other contents before rebooting into the official Windows installation program, with the disk mounted at `/os`.
diff --git a/README.md b/README.md
index e36ece5..9069d4f 100644
--- a/README.md
+++ b/README.md
@@ -181,7 +181,7 @@ bash reinstall.sh anolis 7|8|23
- `--ssh-key KEY` 设置 SSH 登录公钥,[格式如下](#--ssh-key)。当使用公钥时,密码为空
- `--ssh-port PORT` 修改 SSH 端口(安装期间观察日志用,也作用于新系统)
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
-- `--frpc-toml PATH` 添加 frpc 内网穿透,参数填本地路径或 HTTP 链接
+- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
- `--hold 2` 安装结束后不重启,用于 SSH 登录修改系统内容,Debian/Kali 会挂载在 `/target`,其它系统会挂载在 `/os`
@@ -247,7 +247,7 @@ bash reinstall.sh dd --img "https://example.com/xxx.xz"
- `--rdp-port PORT` 修改 RDP 端口 (仅限 DD Windows)
- `--ssh-port PORT` 修改 SSH 端口(安装期间观察日志用)
- `--web-port PORT` 修改 Web 端口(安装期间观察日志用)
-- `--frpc-toml PATH` 添加 frpc 内网穿透(仅限 DD Windows),参数填本地路径或 HTTP 链接
+- `--frpc-config PATH` 添加 frpc 内网穿透(仅限 DD Windows),参数填配置文件的本地路径或 HTTP 链接
- `--cloud-data PATH_OR_URL` 为 DD Linux 镜像注入 cloud-init NoCloud 配置(仅限 DD Linux)
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
- `--hold 2` DD 结束后不重启,用于 SSH 登录修改系统内容,Windows 系统会挂载在 `/os`,Linux 系统**不会**自动挂载
@@ -298,7 +298,7 @@ bash reinstall.sh alpine --hold 1
- `--password PASSWORD` 设置密码
- `--ssh-port PORT` 修改 SSH 端口
- `--ssh-key KEY` 设置 SSH 登录公钥,[格式如下](#--ssh-key)。当使用公钥时,密码为空
-- `--frpc-toml PATH` 添加 frpc 内网穿透,参数填本地路径或 HTTP 链接
+- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
### 功能 4: 重启到
netboot.xyz
@@ -453,7 +453,7 @@ bash reinstall.sh windows \
- `--add-driver INF_OR_DIR` 添加额外驱动,填写 .inf 路径,或者 .inf 所在的文件夹
- 需先下载驱动到当前系统
- 可多次设置该参数以添加不同的驱动
-- `--frpc-toml PATH` 添加 frpc 内网穿透,参数填本地路径或 HTTP 链接
+- `--frpc-config PATH` 添加 frpc 内网穿透,参数填配置文件的本地路径或 HTTP 链接
- `--hold 1` 仅重启到安装环境,不运行安装,用于 SSH 登录验证网络连通性
- `--hold 2` 用于在进入 Windows 官方安装程序之前,SSH 登录修改 `boot.wim`、`install.wim` 或者其它内容,硬盘挂载在 `/os`
diff --git a/debian.cfg b/debian.cfg
index d24aa63..eda5853 100644
--- a/debian.cfg
+++ b/debian.cfg
@@ -206,7 +206,7 @@ d-i preseed/early_command string true; \
ssh-keygen -A; \
run_as_service_with_screen /usr/sbin/sshd -D; \
- if [ -s /configs/frpc.toml ]; then \
+ if ls /configs/frpc.* >/dev/null 2>&1; then \
url=$(sh /get-frpc-url.sh linux); \
mkdir -p /usr/local/bin; \
mkdir -p /usr/local/etc/frpc; \
@@ -217,8 +217,8 @@ d-i preseed/early_command string true; \
sleep 5; \
done; \
chmod a+x /usr/local/bin/frpc; \
- cp /configs/frpc.toml /usr/local/etc/frpc/; \
- run_as_service_with_screen /usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.toml; \
+ cp /configs/frpc.* /usr/local/etc/frpc/; \
+ run_as_service_with_screen /usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.*; \
fi; \
if [ -d /cdrom/simple-cdd ]; then \
@@ -296,11 +296,11 @@ d-i preseed/late_command string true; \
echo "Port $ssh_port" >>/target/etc/ssh/sshd_config; \
fi; \
- if [ -s /configs/frpc.toml ]; then \
+ if ls /configs/frpc.* >/dev/null 2>&1; then \
mkdir -p /target/usr/local/bin; \
mkdir -p /target/usr/local/etc/frpc; \
cp /usr/local/bin/frpc /target/usr/local/bin/; \
- cp /usr/local/etc/frpc/frpc.toml /target/usr/local/etc/frpc/; \
+ cp /usr/local/etc/frpc/frpc.* /target/usr/local/etc/frpc/; \
chmod a+x /target/usr/local/bin/frpc; \
cp /frpc.service /target/etc/systemd/system/; \
in-target systemctl enable frpc; \
diff --git a/frpc.service b/frpc.service
index ba56d04..40168f5 100644
--- a/frpc.service
+++ b/frpc.service
@@ -10,8 +10,8 @@ Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
-ExecStart=/usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.toml
-ExecReload=/usr/local/bin/frpc reload -c /usr/local/etc/frpc/frpc.toml
+ExecStart=/usr/local/bin/frpc -c /usr/local/etc/frpc/frpc.conf
+ExecReload=/usr/local/bin/frpc reload -c /usr/local/etc/frpc/frpc.conf
[Install]
WantedBy=multi-user.target
diff --git a/reinstall.sh b/reinstall.sh
index 4205b25..0c0c54f 100644
--- a/reinstall.sh
+++ b/reinstall.sh
@@ -83,16 +83,16 @@ Usage: $reinstall_____ anolis 7|8|23
netboot.xyz
Options: For Linux/Windows:
- [--password PASSWORD]
- [--ssh-key KEY]
- [--ssh-port PORT]
- [--web-port PORT]
- [--frpc-toml PATH]
+ [--password PASSWORD]
+ [--ssh-key KEY]
+ [--ssh-port PORT]
+ [--web-port PORT]
+ [--frpc-config PATH]
For Windows Only:
[--allow-ping]
- [--rdp-port PORT]
- [--add-driver INF_OR_DIR]
+ [--rdp-port PORT]
+ [--add-driver INF_OR_DIR]
Manual: https://github.com/bin456789/reinstall
@@ -3779,7 +3779,7 @@ This script is outdated, please download reinstall.sh again.
save_password $initrd_dir/configs
fi
if [ -n "$frpc_config" ]; then
- cat "$frpc_config" >$initrd_dir/configs/frpc.toml
+ cat "$frpc_config" >$initrd_dir/configs/frpc.conf
fi
# 收集 cloud-data 打包进 initrd
@@ -3974,7 +3974,7 @@ for o in ci installer debug minimal allow-ping force-cn help \
web-port: http-port: \
allow-ping: \
commit: \
- frpc-conf: frpc-config: frpc-toml: \
+ frpc-conf: frpc-config: \
force-boot-mode: \
force-old-windows-setup:; do
[ -n "$long_opts" ] && long_opts+=,
@@ -3986,9 +3986,7 @@ if ! opts=$(getopt -n $0 -o "h,x" --long "$long_opts" -- "$@"); then
exit
fi
-# /tmp 挂载在内存的话,可能不够空间
-# 处理 --frpc--toml 时会下载文件,因此在处理参数前就创建临时目录
-tmp=/reinstall-tmp
+# 处理 --frpc-config 时会下载文件,因此在处理参数前就创建临时目录
mkdir_clear "$tmp"
eval set -- "$opts"
@@ -4036,13 +4034,14 @@ while true; do
hold=$2
shift 2
;;
- --frpc-conf | --frpc-config | --frpc-toml)
+ --frpc-conf | --frpc-config)
[ -n "$2" ] || error_and_exit "Need value for $1"
case "$(to_lower <<<"$2")" in
http://* | https://*)
frpc_config_url=$2
- frpc_config=$tmp/frpc_config
+ frpc_config=$tmp/frpc.conf
+ # 用 file 识别文件类型?
if ! curl -L "$frpc_config_url" -o "$frpc_config"; then
error_and_exit "Can't get frpc config from $frpc_config_url"
fi
diff --git a/trans.sh b/trans.sh
index 13d886c..4bfdb98 100644
--- a/trans.sh
+++ b/trans.sh
@@ -1539,12 +1539,12 @@ install_alpine() {
chroot /os rc-update add fix-eth-name boot
# 安装 frpc
- if [ -s /configs/frpc.toml ]; then
+ if ls /configs/frpc.* >/dev/null 2>&1; then
chroot /os apk add frp
# chroot rc-update add 默认添加到 sysinit
# 但不加 chroot 默认添加到 default
chroot /os rc-update add frpc boot
- cp /configs/frpc.toml /os/etc/frp/frpc.toml
+ cp -f /configs/frpc.* /os/etc/frp/
fi
# setup-disk 会自动选择固件,但不包括微码?
@@ -1770,19 +1770,40 @@ $(del_comment_lines /dev/null 2>&1; then
nix_frpc=$(
- cat </dev/null 2>&1; then
mkdir -p "$os_dir/usr/local/bin"
mkdir -p "$os_dir/usr/local/etc/frpc"
@@ -1931,7 +1952,7 @@ add_frpc_systemd_service_if_need() {
chmod a+x "$os_dir/usr/local/bin/frpc"
# frpc conf
- cp /configs/frpc.toml "$os_dir/usr/local/etc/frpc/frpc.toml"
+ cp -f /configs/frpc.* "$os_dir/usr/local/etc/frpc/"
# 添加服务
add_systemd_service "$os_dir" frpc
@@ -3092,24 +3113,23 @@ modify_windows() {
done
# 5 frp
- if [ -s /configs/frpc.toml ]; then
- # 好像 win7 无法运行 frpc,暂时不管
- windows_arch=$(get_windows_arch_from_windows_drive "$os_dir" | to_lower)
- if [ "$windows_arch" = amd64 ] || [ "$windows_arch" = arm64 ]; then
- mkdir -p "$os_dir/frpc/"
- url=$(get_frpc_url windows "$nt_ver")
- download "$url" $os_dir/frpc/frpc.zip
- # -j 去除文件夹
- # -C 筛选文件时不区分大小写,但 busybox zip 不支持
- unzip -o -j "$os_dir/frpc/frpc.zip" '*/frpc.exe' -d "$os_dir/frpc/"
- rm -f "$os_dir/frpc/frpc.zip"
- cp -f /configs/frpc.toml "$os_dir/frpc/frpc.toml"
- download "$confhome/windows-frpc.xml" "$os_dir/frpc/frpc.xml"
- download "$confhome/windows-frpc.bat" "$os_dir/frpc/frpc.bat"
- bats="$bats frpc\frpc.bat"
+ if ls /configs/frpc.* >/dev/null 2>&1; then
+ if [ "$(get_windows_arch_from_windows_drive "$os_dir" | to_lower)" = x86 ]; then
+ os_bit=32
else
- warn "$windows_arch Not Support frpc"
+ os_bit=64
fi
+ mkdir -p "$os_dir/frpc/"
+ url=$(get_frpc_url windows "$nt_ver" "$os_bit")
+ download "$url" $os_dir/frpc/frpc.zip
+ # -j 去除文件夹
+ # -C 筛选文件时不区分大小写,但 busybox zip 不支持
+ unzip -o -j "$os_dir/frpc/frpc.zip" '*/frpc.exe' -d "$os_dir/frpc/"
+ rm -f "$os_dir/frpc/frpc.zip"
+ cp -f /configs/frpc.* "$os_dir/frpc/"
+ download "$confhome/windows-frpc.xml" "$os_dir/frpc/frpc.xml"
+ download "$confhome/windows-frpc.bat" "$os_dir/frpc/frpc.bat"
+ bats="$bats frpc\frpc.bat"
fi
if $use_gpo; then
@@ -7565,12 +7585,12 @@ fi
# 设置 frpc
# 并防止重复运行
-if [ -s /configs/frpc.toml ] && ! pidof frpc >/dev/null; then
+if ls /configs/frpc.* >/dev/null 2>&1 && ! pidof frpc >/dev/null; then
info 'run frpc'
add_community_repo
apk add frp
while true; do
- frpc -c /configs/frpc.toml || true
+ frpc -c /configs/frpc.* || true
sleep 5
done &
fi