Don't use EUID var that can already be defined

This commit is contained in:
Jeremy Gardais 2019-05-28 13:54:12 +02:00
parent e374edcb74
commit 4d3bfc9730
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
SUCCESS=0 SUCCESS=0
ERROR=1 ERROR=1
DEBUG=1 DEBUG=1
EUID=$(id -u) USER_ID=$(id -u)
BACKUP_USER_LOGIN="backup" BACKUP_USER_LOGIN="backup"
SUDOERS_LINE_REGEXP="backuppc.*ALL.*=.*(ALL:ALL).*NOEXEC:NOPASSWD:.*/usr/bin/rsync" SUDOERS_LINE_REGEXP="backuppc.*ALL.*=.*(ALL:ALL).*NOEXEC:NOPASSWD:.*/usr/bin/rsync"
@ -68,7 +68,7 @@ EOF
# Test permissions [[[ # Test permissions [[[
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Check admin rights." [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Check admin rights."
if [ "${EUID}" -ne "0" ]; then if [ "${USER_ID}" -ne "0" ]; then
printf '\e[1;31m%-6s\e[m\n' "ERROR: You need to run with SUDO/Admin permissions." printf '\e[1;31m%-6s\e[m\n' "ERROR: You need to run with SUDO/Admin permissions."
exit "${ERROR}" exit "${ERROR}"
fi fi