From e20362ec07222dba3f6716bb45bdd327bc15da47 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 19 May 2022 19:31:38 +0200 Subject: [PATCH] Update install script to be able to run multiple times --- install.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 03e95f4..bee4577 100755 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ SUDO='sudo' ANSIBLE_REPO='https://git.grondek.pl/pgrondek/ansible-desktop.git' if [[ "$EUID" == 0 ]]; then - echo "Run script as normal user" + echo "Run script as normal user" fi "${SUDO}" apt update @@ -14,8 +14,11 @@ fi "${SUDO}" apt-add-repository --yes --update ppa:ansible/ansible "${SUDO}" apt install -y git ansible -mkdir -p "${HOME}/src" -cd "${HOME}/src" -git clone "$ANSIBLE_REPO" -cd ansible-desktop +if [ -d "${HOME}/src/ansible-desktop" ]; then + mkdir -p "${HOME}/src" + cd "${HOME}/src" + git clone "$ANSIBLE_REPO" +fi +cd "${HOME}/src/ansible-desktop" +git pull ansible-playbook localhost.yml