From 690467c9127977409126a2400de24fcaa50bfbcd Mon Sep 17 00:00:00 2001 From: Itiligent <94789708+itiligent@users.noreply.github.com> Date: Sun, 23 Jun 2024 12:45:45 +1000 Subject: [PATCH] add sudo perm checks for both debian and ubuntu --- 1-setup.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index f5afd65..5f7276e 100644 --- a/1-setup.sh +++ b/1-setup.sh @@ -52,10 +52,9 @@ if ! command -v sudo &> /dev/null; then fi # Make sure the user running setup is a member of the sudo group -if ! [[ $(id -nG "$USER" 2>/dev/null | egrep "sudo" | wc -l) -gt 0 ]]; then +if ! id -nG "$USER" | grep -qw "sudo"; then echo - echo -e "${LRED}The current user (${USER}) must be a member of the 'sudo' group. Run: sudo usermod -aG sudo ${USER}" 1>&2 - echo -e ${NC} + echo -e "${LRED}The current user (${USER}) must be a member of the 'sudo' group. Run: sudo usermod -aG sudo ${USER}${NC}" 1>&2 exit 1 fi