Compare commits
9 Commits
v6.0.4
..
43ee724718
| Author | SHA1 | Date | |
|---|---|---|---|
| 43ee724718 | |||
| 4609f90860 | |||
| 9840b42847 | |||
| b59ab5852a | |||
| 48c4efd7b0 | |||
| 9c995962a5 | |||
| a7e414aca4 | |||
| cadee26dba | |||
| cd269cbca1 |
@@ -34,6 +34,12 @@ TestAPIAvailability() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If an error occurred, the variable starts with ;;
|
||||||
|
if [ "${chaos_api_list#;;}" != "${chaos_api_list}" ]; then
|
||||||
|
echo "Communication error. Is FTL running?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Iterate over space-separated list of URLs
|
# Iterate over space-separated list of URLs
|
||||||
while [ -n "${chaos_api_list}" ]; do
|
while [ -n "${chaos_api_list}" ]; do
|
||||||
# Get the first URL
|
# Get the first URL
|
||||||
|
|||||||
@@ -97,6 +97,50 @@ GitCheckUpdateAvail() {
|
|||||||
fi
|
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() {
|
main() {
|
||||||
local basicError="\\n ${COL_LIGHT_RED}Unable to complete update, please contact Pi-hole Support${COL_NC}"
|
local basicError="\\n ${COL_LIGHT_RED}Unable to complete update, please contact Pi-hole Support${COL_NC}"
|
||||||
local core_update
|
local core_update
|
||||||
@@ -198,6 +242,11 @@ main() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
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
|
if [[ "${core_update}" == true ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " ${INFO} Pi-hole core files out of date, updating local repo."
|
echo -e " ${INFO} Pi-hole core files out of date, updating local repo."
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ chmod 0755 /etc/pihole /var/log/pihole
|
|||||||
|
|
||||||
# allow pihole to access subdirs in /etc/pihole (sets execution bit on dirs)
|
# allow pihole to access subdirs in /etc/pihole (sets execution bit on dirs)
|
||||||
# credits https://stackoverflow.com/a/11512211
|
# credits https://stackoverflow.com/a/11512211
|
||||||
find /etc/pihole -type d -exec chmod 0755 {} \;
|
find /etc/pihole/ -type d -exec chmod 0755 {} \;
|
||||||
|
|
||||||
# Touch files to ensure they exist (create if non-existing, preserve if existing)
|
# Touch files to ensure they exist (create if non-existing, preserve if existing)
|
||||||
[ -f "${FTL_PID_FILE}" ] || install -D -m 644 -o pihole -g pihole /dev/null "${FTL_PID_FILE}"
|
[ -f "${FTL_PID_FILE}" ] || install -D -m 644 -o pihole -g pihole /dev/null "${FTL_PID_FILE}"
|
||||||
|
|||||||
+1
-1
@@ -1082,7 +1082,7 @@ migrate_to_listsCache_dir() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Update the list's paths in the corresponding .sha1 files to the new location
|
# Update the list's paths in the corresponding .sha1 files to the new location
|
||||||
sed -i "s|${piholeDir}/|${listsCacheDir}/|g" "${listsCacheDir}"/*.sha1
|
sed -i "s|${piholeDir}/|${listsCacheDir}/|g" "${listsCacheDir}"/*.sha1 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
helpFunc() {
|
helpFunc() {
|
||||||
|
|||||||
Reference in New Issue
Block a user