修改 pass-auth.sh ,可直接替换pkexec使用

This commit is contained in:
shenmo 2025-10-10 14:06:18 +08:00
parent 831008dcbe
commit 9936b10d37

View File

@ -1,6 +1,3 @@
#!/bin/bash
# We use sudo twice to avoid ACE bug here
# https://gitee.com/amber-ce/amber-ce-bookworm/commit/43e1a1599ede474b37e41aa10c53fd8afc4d35a1
#!/bin/bash
# We use sudo twice to avoid ACE bug here
@ -14,6 +11,12 @@ function zenity_prompt() {
fi
}
if [ "${IS_ACE_ENV}" = "" ]; then
echo "检测为非ACE环境直接提权"
pkexec "$@"
exit $?
fi
# 检查sudo是否需要密码
if sudo -n true 2>/dev/null; then
echo "sudo 无需密码,继续执行"