From 0cd86abf6052907834d7ba990d8405fad3c827a3 Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 22 Aug 2023 14:37:30 +0200 Subject: [PATCH] install.sh aktualisiert --- install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 1ef0574..7319a85 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,13 @@ set -e # on fresh install remove cdrom-repo and install sudo if not available which sudo >/dev/null 2>&1 || su -c "sed -i '/cdrom/d' /etc/apt/sources.list ; apt update ; apt -y install sudo" -id | grep -q '(sudo)' || su -c "/usr/sbin/usermod -a -G sudo ${USER}" +# add user to sudo group it not +if ! id | grep -q '(sudo)' +then + su -c "/usr/sbin/usermod -a -G sudo ${USER}" + # use sudo group without + exec sg sudo "newgrp `id -gn`" +fi sudo apt-get -y install ansible git