From fd4223e90484a81194a52f5737492100ba1269d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Sun, 2 Feb 2025 03:48:01 +0100 Subject: [PATCH] [convertdomain] Add option to skip DNS operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernhard Rosenkränzer --- bin/convertdomain | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/convertdomain b/bin/convertdomain index a86a97f..a0cd4b9 100755 --- a/bin/convertdomain +++ b/bin/convertdomain @@ -55,7 +55,7 @@ check_gluerecords() { do_serviceprep_dns() { # Create DNS records for newdomain docker exec pdns pdnsutil create-zone $DOMAIN_NEW - docker exec pdns pdnsutil set-kind $DOMAIN_NEW native + docker exec pdns pdnsutil set-kind $DOMAIN_NEW primary docker exec pdns pdnsutil set-meta $DOMAIN_NEW SOA-EDIT-API DEFAULT for i in ns1 powerdns traefik mail www computer panel nextcloud collabora jitsi matrix element listmonk vaultwarden vpn wireguard baserow gitea blog documentation podcasts castopod caddy wordpress bookstack freescout msp espocrm dashboard plane calcom; do @@ -890,6 +890,12 @@ usage() { exit 2 } +DNS_DONE=false +if [ "$1" = "-d" -o "$1" = "--dns-done" ]; then + DNS_DONE=true + shift +fi + [ $# != 2 ] && usage DOMAIN_NEW=$1 ORG_NEW=$2 @@ -918,9 +924,11 @@ MYSQL_ROOTPASSWORD=`cat /federated/apps/pdnsmysql/.env | grep MYSQL_ROOT_PASSWOR echo -ne "\n\nConverting Federated Core $DOMAIN to $DOMAIN_NEW.\n\n" # Key initial steps -check_gluerecords +if ! $DNS_DONE; then + check_gluerecords #get_installedapps -do_serviceprep_dns + do_serviceprep_dns +fi do_serviceprep_ldap # Stop all services