From 4f268ed193f2b552b7518b64b531ff0b1a7654e3 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 21 Dec 2024 07:10:46 +0100 Subject: [PATCH 1/6] Explicitly migrate from v5 to v6 Signed-off-by: DL6ER --- automated install/basic-install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 755d8dd9..863ac432 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2326,6 +2326,12 @@ migrate_dnsmasq_configs() { mv /etc/dnsmasq.d/0{1,2,4,5}-pihole*.conf "${V6_CONF_MIGRATION_DIR}/" 2>/dev/null || true mv /etc/dnsmasq.d/06-rfc6761.conf "${V6_CONF_MIGRATION_DIR}/" 2>/dev/null || true + + # Finally, after everything is in place, we can create the new config file + # /etc/pihole/pihole.toml + # This file will be created with the default settings unless the user has + # changed settings via setupVars.conf or the other dnsmasq files moved above + pihole-FTL migrate v6 } main() { From 8faa28d8a01cc5e8b67058502af25ba53a3bfa0f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 23 Dec 2024 08:48:05 +0100 Subject: [PATCH 2/6] Explicitly log migration process Signed-off-by: DL6ER --- automated install/basic-install.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 863ac432..c6ac0fbf 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2331,7 +2331,20 @@ migrate_dnsmasq_configs() { # /etc/pihole/pihole.toml # This file will be created with the default settings unless the user has # changed settings via setupVars.conf or the other dnsmasq files moved above - pihole-FTL migrate v6 + str="Migrating Pi-hole configuration to version 6" + printf " %b %s...\\n" "${INFO}" + local FTLoutput FTLstatus + FTLoutput=$(pihole-FTL migrate v6) + FTLstatus=$? + if [[ "${FTLstatus}" -eq 0 ]]; then + printf " %b %s\\n" "${TICK}" "${str}" + else + printf " %b %s\\n" "${CROSS}" "${str}" + fi + + # Print the output of the FTL migration prefacing every line with four + # spaces for alignment + printf "%b" "${FTLoutput}" | sed 's/^/ /' } main() { From d14273f958fa4b73b8cf321a936edd7e5364c035 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 24 Dec 2024 02:17:50 +0100 Subject: [PATCH 3/6] Add comment where setupVars.conf goes when v6 migration is done Signed-off-by: DL6ER --- automated install/basic-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index c6ac0fbf..6d97d7e0 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2331,6 +2331,7 @@ migrate_dnsmasq_configs() { # /etc/pihole/pihole.toml # This file will be created with the default settings unless the user has # changed settings via setupVars.conf or the other dnsmasq files moved above + # During migration, setupVars.conf is moved to /etc/pihole/migration_backup_v6 str="Migrating Pi-hole configuration to version 6" printf " %b %s...\\n" "${INFO}" local FTLoutput FTLstatus From 4d23187f864c143e526af069ae899ffdf6f891ac Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 6 Jan 2025 18:33:23 +0100 Subject: [PATCH 4/6] Add missing newline Signed-off-by: DL6ER --- automated install/basic-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index cb7324f5..7afdc313 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2365,6 +2365,9 @@ migrate_dnsmasq_configs() { # Print the output of the FTL migration prefacing every line with four # spaces for alignment printf "%b" "${FTLoutput}" | sed 's/^/ /' + + # Print a blank line for separation + printf "\\n" } # Check for availability of either the "service" or "systemctl" commands From 211a88188827d290c01b3441891047f1a911be9a Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 8 Jan 2025 19:28:15 +0100 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: yubiuser Signed-off-by: Dominik --- automated install/basic-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 7afdc313..a274f22d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2352,14 +2352,14 @@ migrate_dnsmasq_configs() { # changed settings via setupVars.conf or the other dnsmasq files moved above # During migration, setupVars.conf is moved to /etc/pihole/migration_backup_v6 str="Migrating Pi-hole configuration to version 6" - printf " %b %s...\\n" "${INFO}" + printf " %b %s...\\n" "${INFO}" "${str}" local FTLoutput FTLstatus FTLoutput=$(pihole-FTL migrate v6) FTLstatus=$? if [[ "${FTLstatus}" -eq 0 ]]; then - printf " %b %s\\n" "${TICK}" "${str}" + printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}" else - printf " %b %s\\n" "${CROSS}" "${str}" + printf "%b %b %s\\n" "${OVER}" "${CROSS}" "${str}" fi # Print the output of the FTL migration prefacing every line with four From 4be130971e0f9e5d09c7747204ff17b70bcf554e Mon Sep 17 00:00:00 2001 From: Dominik Date: Thu, 9 Jan 2025 18:32:04 +0100 Subject: [PATCH 6/6] Update automated install/basic-install.sh Co-authored-by: yubiuser Signed-off-by: Dominik --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index a274f22d..719a57fc 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2352,7 +2352,7 @@ migrate_dnsmasq_configs() { # changed settings via setupVars.conf or the other dnsmasq files moved above # During migration, setupVars.conf is moved to /etc/pihole/migration_backup_v6 str="Migrating Pi-hole configuration to version 6" - printf " %b %s...\\n" "${INFO}" "${str}" + printf " %b %s..." "${INFO}" "${str}" local FTLoutput FTLstatus FTLoutput=$(pihole-FTL migrate v6) FTLstatus=$?