From cae58502e08a6b5da0b724bd416b98b856bffd0a Mon Sep 17 00:00:00 2001 From: A1EF Date: Sat, 23 Jul 2022 22:59:41 +0300 Subject: [PATCH] Little improvement of `install.sh` --- install.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) mode change 100644 => 100755 install.sh diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index da43af7..16e3aaf --- a/install.sh +++ b/install.sh @@ -2,10 +2,10 @@ set -euo pipefail -UBUNTU_VERSION=$(fgrep VERSION_ID /etc/os-release | cut -d\" -f2) -UBUNTU_CODENAME=$(fgrep VERSION_CODENAME /etc/os-release | cut -d= -f2) +UBUNTU_VERSION=$(grep -F VERSION_ID /etc/os-release | cut -d\" -f2) +UBUNTU_CODENAME=$(grep -F VERSION_CODENAME /etc/os-release | cut -d= -f2) -apt-get update -y +apt-get update apt-get dist-upgrade -y apt-get install wget gnupg add-apt-key -y @@ -74,7 +74,6 @@ gitfs_saltenv_whitelist: base gitfs_update_interval: 80 - EOF systemctl restart salt-master @@ -83,9 +82,9 @@ cat < /etc/salt/minion_id opensourcewebsite.org EOF -cat <> /etc/salt/minion -master: 127.0.0.1 -EOF +if ! grep -Fq 'master: 127.0.0.1' /etc/salt/minion; then + echo 'master: 127.0.0.1' >> /etc/salt/minion +fi systemctl restart salt-minion