From 3d4eeaa5e5bd13214442442992bd5d21a9b166a8 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Fri, 15 Oct 2021 09:12:40 -0400 Subject: [PATCH] check for existence, not zero-length --- templates/setup-functions | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/setup-functions b/templates/setup-functions index bda845a..ab35e24 100755 --- a/templates/setup-functions +++ b/templates/setup-functions @@ -171,7 +171,7 @@ fi ## Munin on monitor servers. if [ -e "$WD/Munin/munin-cron.crontab" ] ### This file only should exist on a monitoring server. then - if crontab -u munin "$WD/Munin/munin-cron.crontab" then sleep 2 echo "Running munin-cron manually for first time." echo "This may take a while the first time..." + if crontab -u munin "$WD/Munin/munin-cron.crontab"; then sleep 2 echo "Running munin-cron manually for first time." echo "This may take a while the first time..." sudo su -c munin-cron --shell=/bin/bash munin else echo "Failed to install crontab for munin. Not running" @@ -191,8 +191,9 @@ fi } Add_PG_APT_Repo () { -if [ -z /etc/apt/sources.list.d/pgdg.list ]; then - wget https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null +if [ ! -e /etc/apt/sources.list.d/pgdg.list ]; then + $APT_TOOL install curl ca-certificates gnupg + curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' fi } -- 2.11.0