mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-21 21:53:43 +00:00
Use pihole.toml to decide if installer runs on an update
Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
parent
74d451a9c7
commit
74e52675f1
1 changed files with 15 additions and 11 deletions
|
@ -77,6 +77,7 @@ PI_HOLE_FILES=(list piholeDebug piholeLogFlush setupLCD update version gravity u
|
||||||
PI_HOLE_INSTALL_DIR="/opt/pihole"
|
PI_HOLE_INSTALL_DIR="/opt/pihole"
|
||||||
PI_HOLE_CONFIG_DIR="/etc/pihole"
|
PI_HOLE_CONFIG_DIR="/etc/pihole"
|
||||||
PI_HOLE_BIN_DIR="/usr/local/bin"
|
PI_HOLE_BIN_DIR="/usr/local/bin"
|
||||||
|
PI_HOLE_V6_CONFIG="${PI_HOLE_CONFIG_DIR}/pihole.toml"
|
||||||
if [ -z "$useUpdateVars" ]; then
|
if [ -z "$useUpdateVars" ]; then
|
||||||
useUpdateVars=false
|
useUpdateVars=false
|
||||||
fi
|
fi
|
||||||
|
@ -2194,7 +2195,7 @@ migrate_dnsmasq_configs() {
|
||||||
|
|
||||||
# Exit early if this is already Pi-hole v6.0
|
# Exit early if this is already Pi-hole v6.0
|
||||||
# We decide this on the presence of the file /etc/pihole/pihole.toml
|
# We decide this on the presence of the file /etc/pihole/pihole.toml
|
||||||
if [[ -f /etc/pihole/pihole.toml ]]; then
|
if [[ -f "${PI_HOLE_V6_CONFIG}" ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2289,16 +2290,19 @@ main() {
|
||||||
printf " %b Checking for / installing Required dependencies for this install script...\\n" "${INFO}"
|
printf " %b Checking for / installing Required dependencies for this install script...\\n" "${INFO}"
|
||||||
install_dependent_packages "${INSTALLER_COMMON_DEPS[@]}" "${INSTALLER_DEPS[@]}"
|
install_dependent_packages "${INSTALLER_COMMON_DEPS[@]}" "${INSTALLER_DEPS[@]}"
|
||||||
|
|
||||||
# if it's running unattended,
|
# in case of an update
|
||||||
if [[ "${runUnattended}" == true ]]; then
|
if [[ -f "${PI_HOLE_V6_CONFIG}" ]]; then
|
||||||
printf " %b Performing unattended setup, no dialogs will be displayed\\n" "${INFO}"
|
# if it's running unattended,
|
||||||
# Use the setup variables
|
if [[ "${runUnattended}" == true ]]; then
|
||||||
useUpdateVars=true
|
printf " %b Performing unattended setup, no dialogs will be displayed\\n" "${INFO}"
|
||||||
# also disable debconf-apt-progress dialogs
|
# Use the setup variables
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
useUpdateVars=true
|
||||||
else
|
# also disable debconf-apt-progress dialogs
|
||||||
# If running attended, show the available options (repair/reconfigure)
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
update_dialogs
|
else
|
||||||
|
# If running attended, show the available options (repair/reconfigure)
|
||||||
|
update_dialogs
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${useUpdateVars}" == false ]]; then
|
if [[ "${useUpdateVars}" == false ]]; then
|
||||||
|
|
Loading…
Reference in a new issue