fix: Logic to check root incorrect in agent.sh running on Chinese version of Ubuntu (OD-2538)

This commit is contained in:
Robin Shen 2025-08-25 22:07:01 +08:00
parent 7b8e9f7cba
commit afddedc308

View File

@ -216,7 +216,7 @@ gettext() {
} }
checkIsRoot() { checkIsRoot() {
if [ `id | sed 's/^uid=//;s/(.*$//'` != "0" ] ; then if [ `id -u` != "0" ] ; then
IS_ROOT=false IS_ROOT=false
else else
IS_ROOT=true IS_ROOT=true