Don't use EUID var that can already be defined
This commit is contained in:
parent
e374edcb74
commit
4d3bfc9730
|
@ -8,7 +8,7 @@
|
|||
SUCCESS=0
|
||||
ERROR=1
|
||||
DEBUG=1
|
||||
EUID=$(id -u)
|
||||
USER_ID=$(id -u)
|
||||
|
||||
BACKUP_USER_LOGIN="backup"
|
||||
SUDOERS_LINE_REGEXP="backuppc.*ALL.*=.*(ALL:ALL).*NOEXEC:NOPASSWD:.*/usr/bin/rsync"
|
||||
|
@ -68,7 +68,7 @@ EOF
|
|||
|
||||
# Test permissions [[[
|
||||
[ "${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."
|
||||
exit "${ERROR}"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue