Compare commits

...

4 Commits

Author SHA1 Message Date
3b92ec05cc Merge pull request 'tweak/update' (#13) from tweak/update into master
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Check for merge conflicts / main (push) Has been cancelled
Sync Back to Development / Syncing branches (push) Has been cancelled
Reviewed-on: #13
2026-03-18 14:10:19 +00:00
d34d3f558a Merge branch 'master' into tweak/update
Some checks are pending
Check for merge conflicts / main (push) Waiting to run
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (alpine_3_21) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (alpine_3_23) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_10) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_13) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_42) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_43) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Check for merge conflicts / main (pull_request_target) Waiting to run
2026-03-18 14:10:10 +00:00
Christian König
43ee724718 Improve alignment and add link to blog post
Some checks are pending
CodeQL / Analyze (pull_request) Waiting to run
Test Supported Distributions / smoke-tests (pull_request) Waiting to run
Test Supported Distributions / distro-test (centos_9) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_11) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (debian_12) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_40) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (fedora_41) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_20) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_22) (pull_request) Blocked by required conditions
Test Supported Distributions / distro-test (ubuntu_24) (pull_request) Blocked by required conditions
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-26 13:30:46 +01:00
Christian König
4609f90860 Show an warning dialoge before performing an update
Signed-off-by: Christian König <github@yubiuser.dev>
2025-02-25 14:33:30 +01:00

View File

@@ -102,6 +102,50 @@ GitCheckUpdateAvail() {
fi
}
updateWarnDialog() {
# Display the warning dialog
local core_str web_str ftl_str
if [[ "${core_update}" == true ]]; then
core_str="Core: \\Zb\\Z1update available\\Zn"
else
core_str="Core: \\Zb\\Z4up to date\\Zn"
fi
if [[ "${web_update}" == true ]]; then
web_str="Web: \\Zb\\Z1update available\\Zn"
else
web_str="Web: \\Zb\\Z4up to date\\Zn"
fi
if [[ "${FTL_update}" == true ]]; then
ftl_str="FTL: \\Zb\\Z1update available\\Zn"
else
ftl_str="FTL: \\Zb\\Z4up to date\\Zn"
fi
# shellcheck disable=SC2154 # Variables "${r}" "${c}" are defined in the main script
dialog --no-shadow --clear --keep-tite \
--colors \
--backtitle "Updating Pi-hole" \
--title "Warning" \
--no-button "Exit" --yes-button "Continue" \
--defaultno \
--yesno "\\nThe following Pi-hole components are going to be updated.\\n\\n\\n\
$core_str\\n\
$web_str\\n\
$ftl_str\\n\\n\\n\
\\Zb\\Z1IMPORTANT:\\Zn Make a (teleporter) backup of your system!\\n\\n\
Updates can come with significant changes. Please read the changelog at https://pi-hole.net/blog carefully.\\n\\n\\n\
Please confirm you want to start the update process." \
"${r}" "${c}" && result=0 || result="$?"
case "${result}" in
"${DIALOG_CANCEL}" | "${DIALOG_ESC}")
printf " %b User canceled the update process.\\n" "${INFO}"
exit 1
;;
esac
}
main() {
local basicError="\\n ${COL_RED}Unable to complete update, please contact Pi-hole Support${COL_NC}"
local core_update
@@ -208,6 +252,11 @@ main() {
exit 0
fi
# if there is any update, show the warning dialog and ask for confirmation
if [[ "${core_update}" == true || "${web_update}" == true || "${FTL_update}" == true ]]; then
updateWarnDialog
fi
if [[ "${core_update}" == true ]]; then
echo ""
echo -e " ${INFO} Pi-hole core files out of date, updating local repo."