Files
cool/apk-untrusted-toggle.sh

16 lines
445 B
Bash
Raw Normal View History

2026-06-07 21:18:36 +08:00
#!/bin/sh
2026-06-07 21:55:28 +08:00
PKG_SCRIPT="/usr/libexec/package-manager-call"
2026-06-07 21:18:36 +08:00
2026-06-07 21:55:28 +08:00
# 检查文件是否存在
if [ ! -f "$PKG_SCRIPT" ]; then
echo "错误:目标脚本 $PKG_SCRIPT 不存在!"
echo "请修改脚本里的 PKG_SCRIPT 变量为真实路径"
exit 1
2026-06-07 21:28:16 +08:00
fi
2026-06-07 21:58:42 +08:00
# 自动替换
sed -i 's/^[[:space:]]*action="add"$/ action="add --allow-untrusted"/' "$PKG_SCRIPT"
2026-06-07 21:55:28 +08:00
2026-06-07 21:58:42 +08:00
echo "✅ 修改完成!"
grep -n "add --allow-untrusted" "$PKG_SCRIPT"