From 95f04cd9ecf584fe039b867ffb1df626ae63fc49 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Wed, 1 Dec 2021 00:55:53 +0100 Subject: [PATCH] Update install script --- install.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index cb711bd..d42715a 100755 --- a/install.sh +++ b/install.sh @@ -1,12 +1,21 @@ #!/usr/bin/env bash -if [[ "$EUID" -ne 0 ]]; then - echo "You need to be root" - sudo $0 $@ - exit +set -e + +SUDO='sudo' +ANSIBLE_REPO='https://git.grondek.pl/pgrondek/ansible-desktop.git' + +if [[ "$EUID" == 0 ]]; then + echo "Run script as normal user" fi -apt update -apt install software-properties-common -apt-add-repository --yes --update ppa:ansible/ansible -apt install -y git ansible +$(SUDO) apt update +$(SUDO) apt install software-properties-common +$(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 +ansible-playbook localhost.yml