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