Files
dock/istc
2026-01-22 22:42:22 +08:00

38 lines
1.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
cat << 'EOF' > /tmp/update_source.sh
#!/bin/sh
echo "正在执行 iStoreOS 国内源替换脚本..."
# 1. 备份原始配置,防止意外
mkdir -p /etc/opkg/backup
cp /etc/opkg/*.conf /etc/opkg/backup/
echo "已备份原始配置文件到 /etc/opkg/backup/"
# 2. 全量替换为腾讯云镜像 (解决 distfeeds, customfeeds, compatfeeds 等所有文件的连接问题)
# 针对你截图中的 cernet 地址进行精准替换
sed -i 's/mirrors.cernet.edu.cn/mirrors.tencent.com/g' /etc/opkg/*.conf
echo "源地址已修改为腾讯云镜像。"
# 3. 强制更新索引
echo "正在更新软件包索引,请稍候..."
opkg update
# 4. 尝试在线安装 PassWall 缺失的 3 个核心零件
echo "正在安装基础依赖组件..."
opkg install chinadns-ng dns2socks tcping microsocks coreutils-base64 coreutils-nohup
# 5. 检查安装结果
echo "-----------------------------------------------"
if [ -f "/usr/bin/chinadns-ng" ] || [ -f "/usr/bin/dns2socks" ]; then
echo "恭喜!核心零件安装成功。"
echo "现在你可以去 iStore 界面离线安装 PassWall 主程序了。"
echo "或者运行opkg install /tmp/*.ipk --force-depends"
else
echo "部分组件在线安装失败,建议检查路由器联网状态或手动上传零件包。"
fi
echo "-----------------------------------------------"
EOF
# 赋予执行权限并运行
chmod +x /tmp/update_source.sh
/tmp/update_source.sh