You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

run.sh 775B

12345678910111213141516171819202122232425262728293031323334
  1. #! /usr/bin/env bash
  2. sleep 5
  3. export PDNS_RECURSOR_HOST="$(getent hosts ${PDNS_RECURSOR_HOST} | cut -d' ' -f1)"
  4. . /common.sh
  5. replace_files
  6. for index in {0..1}
  7. do
  8. var_name=POSTGRES_SLAVE_ENABLED_"${index}"
  9. if [ "${!var_name}" == 1 ]
  10. then
  11. echo "Found slave ${index}"
  12. pg_host=POSTGRES_SLAVE_HOST_"${index}"
  13. pg_db=POSTGRES_SLAVE_DB_"${index}"
  14. pg_user=POSTGRES_SLAVE_USER_"${index}"
  15. pg_pwd=POSTGRES_SLAVE_PASSWORD_"${index}"
  16. cat << EOF >> /etc/powerdns/pdns.conf
  17. launch+=gpgsql:slave${index}
  18. gpgsql-slave${index}-host=${!pg_host}
  19. gpgsql-slave${index}-port=
  20. gpgsql-slave${index}-dbname=${!pg_db}
  21. gpgsql-slave${index}-user=${!pg_user}
  22. gpgsql-slave${index}-password=${!pg_pwd}
  23. gpgsql-slave${index}-dnssec=yes
  24. EOF
  25. fi
  26. done
  27. pdns_server --daemon=no