jean-cloud-services/services/ns1.jean-cloud.org/deploy.sh
Adrian Amaglio 13a9891e71 pouloulou…
2023-09-13 10:46:02 +02:00

57 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
. driglibash-base
. "$(where)/helper_functions.sh"
set -euo pipefail
# Working variables
debian_bind_confdir="/etc/bind"
autoconf_separator=";;; Autogeneration. Do not write under this line! ;;;"
# File that contain "service target" lines
# With service a symbolic dns name and target an existing server hostname
servicefile="/docker/services.txt"
# The bind file containing server declarations
server_zone_file="template.db.jean-cloud.org"
# Where you want your DNS keys stored
keydir="$DATA_DIR/keys"
# IP of primary servers
primary_ips=""
# IP of secondary servers (for zone transfer)
secondary_ips="37.65.119.74"
# NS name
default_dns_name="shlago.jean-cloud.org."
run () {
if [ "$#" -ne 1 ] ; then
die "Usage: run <primary|secondary>"
fi
prepare
primary_ips="$primary_ips;$(fakeresolve_ip_list raku)"
secondary_ips="$secondary_ips;$(fakeresolve_ip_list shlago)"
if [ "$1" = "primary" ] ; then
create_primary_files
else
create_secondary_files
fi
restart
}
main () {
run primary
}
# Do not execute main if script is sourced
! (return 0 2>/dev/null) && main "$@" || true # return 0 whatever happends