Check if user belongs to sudo group

Fixes #12
This commit is contained in:
Eduardo Mozart de Oliveira 2023-08-09 14:47:08 -03:00 committed by GitHub
parent f7f37e103c
commit 75604258a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,13 @@ if [[ $EUID -eq 0 ]]; then
exit 1
fi
if ! [ $(id -nG "$USER" 2>/dev/null | egrep "sudo" | wc -l) -gt 0 ]; then
echo
echo -e "${LRED}The current user (${USER}) does not belong to 'sudo' group." 1>&2
echo -e ${NC}
exit 1
fi
# Check to see if previous build/install files exist, stop and check to be safe.
if [ "$(find . -maxdepth 1 \( -name 'guacamole-*' -o -name 'mysql-connector-j-*' \))" != "" ]; then
# Script branding header