Merge pull request 'Move unattended check to the top of the script - exit early if /etc/pihole/pihole.toml file is not found,' (#1) from tweak/6380 into master
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -196,6 +196,17 @@ for var in "$@"; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ "${runUnattended}" == true ]]; then
|
||||||
|
# In order to run an unattended setup, a pre-seeded /etc/pihole/pihole.toml must exist
|
||||||
|
if [[ ! -f "${PI_HOLE_CONFIG_DIR}/pihole.toml" ]]; then
|
||||||
|
printf " %b Error: \"%s\" not found. Cannot run unattended setup\\n" "${CROSS}" "${PI_HOLE_CONFIG_DIR}/pihole.toml"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
printf " %b Performing unattended setup, no dialogs will be displayed\\n" "${INFO}"
|
||||||
|
# also disable debconf-apt-progress dialogs
|
||||||
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
|
fi
|
||||||
|
|
||||||
# If the color table file exists,
|
# If the color table file exists,
|
||||||
if [[ -f "${coltable}" ]]; then
|
if [[ -f "${coltable}" ]]; then
|
||||||
# source it
|
# source it
|
||||||
@@ -2330,15 +2341,6 @@ main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${fresh_install}" == false ]]; then
|
|
||||||
# if it's running unattended,
|
|
||||||
if [[ "${runUnattended}" == true ]]; then
|
|
||||||
printf " %b Performing unattended setup, no dialogs will be displayed\\n" "${INFO}"
|
|
||||||
# also disable debconf-apt-progress dialogs
|
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${fresh_install}" == true ]]; then
|
if [[ "${fresh_install}" == true ]]; then
|
||||||
# Display welcome dialogs
|
# Display welcome dialogs
|
||||||
welcomeDialogs
|
welcomeDialogs
|
||||||
|
|||||||
Reference in New Issue
Block a user