From fa6719db5418cc198af051fff3aee1dfe86157a5 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 6 Feb 2024 10:30:35 -0800 Subject: [PATCH] change sudo to work stack-panel way --- bin/pdns.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pdns.sh b/bin/pdns.sh index 586b12a..a5b6cfc 100755 --- a/bin/pdns.sh +++ b/bin/pdns.sh @@ -8,8 +8,8 @@ # powerdns-tools include file, used by other powerdns-tools bash scripts # Must be root, attempt sudo if need be. root is not actually required for the API commands, but we want to restrict access. -if [ "${EUID}" -ne 0 ]; then - exec sudo -u root --shell /bin/bash $0 $@ +if [ "$USER" != "root" ]; then + exec sudo -u root $0 $@ fi # Load local config