From 38a54ff944ea7f252654d3fa6a9aeeeff2a4a6c1 Mon Sep 17 00:00:00 2001 From: olli Date: Wed, 23 Aug 2023 14:05:25 +0200 Subject: [PATCH] install.sh aktualisiert --- install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 4ce15e0..652d63e 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,14 @@ 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 and restart this script + exec sg sudo -c "bash $0" + exit $? +fi sudo apt-get -y install ansible git @@ -17,6 +24,7 @@ rm -rf $(hostname -s)-git mkdir $(hostname -s)-git cd $(hostname -s)-git + for playbook in \ debian.ansible.basics \ debian.ansible.runchecks \