From ceb65586300bca1af506976b6aa2f84d58861a65 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 31 Jan 2020 16:22:30 +0100 Subject: ishtar-prepare-instance: simplify for pg11 - condition on dnsmasq --- install/ishtar-prepare-instance | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'install') diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance index 55c66df33..c670cb6c7 100755 --- a/install/ishtar-prepare-instance +++ b/install/ishtar-prepare-instance @@ -210,25 +210,14 @@ EOF fi # dnsmasq - echo "* adding domain to local dnsmasq entry" - echo "address=/"$URL"/127.0.0.1" >> /etc/dnsmasq.d/ishtar - systemctl restart dnsmasq + if [ -f /etc/dnsmasq.d/ ]; then + echo "* adding domain to local dnsmasq entry" + echo "address=/"$URL"/127.0.0.1" >> /etc/dnsmasq.d/ishtar + systemctl restart dnsmasq + fi export PG_VERSION DB_HOST DB_PORT DB_PASSWORD DB_NAME POSTGIS_VERSION su postgres <<'EOF' - echo " * Checking template_postgis" - if ! psql -l | grep -qs template_postgis; then - echo " - not present, creating" - createdb -E UTF8 template_postgis - psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis'" - psql -q -d template_postgis -f /usr/share/postgresql/$PG_VERSION/extension/postgis--$POSTGIS_VERSION.sql - psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" - psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;" - psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;" - else - echo " - already present" - fi - echo " * Checking database $DB_NAME" if ! psql -l | grep -qs "$DB_NAME"; then echo " - not present, creating" -- cgit v1.2.3