Files
cool/apk-untrusted-toggle.sh
2026-06-07 21:58:42 +08:00

16 lines
445 B
Bash

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