From: Chris Sharp Date: Fri, 15 Oct 2021 13:12:40 +0000 (-0400) Subject: check for existence, not zero-length X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3d4eeaa5e5bd13214442442992bd5d21a9b166a8;p=contrib%2Fpines%2Fgenasys.git check for existence, not zero-length --- 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 }