Remove 'reconfigure' option

Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
Christian König 2025-02-06 21:26:14 +01:00
parent 9d53ad7668
commit 49cf5bb221
No known key found for this signature in database
4 changed files with 26 additions and 40 deletions

View File

@ -218,7 +218,7 @@ main() {
fi
if [[ "${FTL_update}" == true || "${core_update}" == true ]]; then
${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --reconfigure --unattended || \
${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --repair --unattended || \
echo -e "${basicError}" && exit 1
fi

View File

@ -7,7 +7,7 @@ _pihole() {
case "${prev}" in
"pihole")
opts="allow allow-regex allow-wild deny checkout debug disable enable flush help logging query reconfigure regex reloaddns reloadlists status tail uninstall updateGravity updatePihole version wildcard arpflush api"
opts="allow allow-regex allow-wild deny checkout debug disable enable flush help logging query repair regex reloaddns reloadlists status tail uninstall updateGravity updatePihole version wildcard arpflush api"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
;;
"allow"|"deny"|"wildcard"|"regex"|"allow-regex"|"allow-wild")

View File

@ -142,12 +142,12 @@ EOM
######## Undocumented Flags. Shhh ########
# These are undocumented flags; some of which we can use when repairing an installation
# The runUnattended flag is one example of this
reconfigure=false
repair=false
runUnattended=false
# Check arguments for the undocumented flags
for var in "$@"; do
case "$var" in
"--reconfigure") reconfigure=true ;;
"--repair") repair=true ;;
"--unattended") runUnattended=true ;;
esac
done
@ -1111,7 +1111,7 @@ setPrivacyLevel() {
# A function to display a list of example blocklists for users to select
chooseBlocklists() {
# Back up any existing adlist file, on the off chance that it exists. Useful in case of a reconfigure.
# Back up any existing adlist file, on the off chance that it exists.
if [[ -f "${adlistFile}" ]]; then
mv "${adlistFile}" "${adlistFile}.old"
fi
@ -1787,21 +1787,12 @@ displayFinalMessage() {
\\n${additional}" "${r}" "${c}"
}
update_dialogs() {
# If pihole -r "reconfigure" option was selected,
if [[ "${reconfigure}" = true ]]; then
# set some variables that will be used
opt1a="Repair"
opt1b="This will retain existing settings"
strAdd="You will remain on the same version"
else
# Otherwise, set some variables with different values
opt1a="Update"
opt1b="This will retain existing settings."
strAdd="You will be updated to the latest version."
fi
opt2a="Reconfigure"
opt2b="Resets Pi-hole and allows re-selecting settings."
repair_dialog() {
# pihole -r/--repair option was selected
# set some variables that will be used
opt1a="Repair"
opt1b="This will retain existing settings"
strAdd="You will remain on the same version"
# Display the information to the user
UpdateCmd=$(dialog --no-shadow --keep-tite --output-fd 1 \
@ -1810,9 +1801,8 @@ update_dialogs() {
--menu "\\n\\nWe have detected an existing install.\
\\n\\nPlease choose from the following options:\
\\n($strAdd)" \
"${r}" "${c}" 2 \
"${opt1a}" "${opt1b}" \
"${opt2a}" "${opt2b}") || result=$?
"${r}" "${c}" 1 \
"${opt1a}" "${opt1b}") || result=$?
case ${result} in
"${DIALOG_CANCEL}" | "${DIALOG_ESC}")
@ -1823,16 +1813,11 @@ update_dialogs() {
# Set the variable based on if the user chooses
case ${UpdateCmd} in
# repair, or
# repair
"${opt1a}")
printf " %b %s option selected\\n" "${INFO}" "${opt1a}"
useUpdateVars=true
;;
# reconfigure,
"${opt2a}")
printf " %b %s option selected\\n" "${INFO}" "${opt2a}"
useUpdateVars=false
;;
esac
}
@ -1923,9 +1908,9 @@ checkout_pull_branch() {
}
clone_or_update_repos() {
# If the user wants to reconfigure,
if [[ "${reconfigure}" == true ]]; then
printf " %b Performing reconfiguration, skipping download of local repos\\n" "${INFO}"
# If the user wants to repair/update,
if [[ "${repair}" == true ]]; then
printf " %b Resetting local repos\\n" "${INFO}"
# Reset the Core repo
resetRepo ${PI_HOLE_LOCAL_REPO} ||
{
@ -1938,7 +1923,7 @@ clone_or_update_repos() {
printf " %b Unable to reset %s, exiting installer%b\\n" "${COL_LIGHT_RED}" "${webInterfaceDir}" "${COL_NC}"
exit 1
}
# Otherwise, a repair is happening
# Otherwise, a fresh installation is happening
else
# so get git files for Core
getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} ||
@ -2455,8 +2440,9 @@ main() {
# also disable debconf-apt-progress dialogs
export DEBIAN_FRONTEND="noninteractive"
else
# If running attended, show the available options (repair/reconfigure)
update_dialogs
# If running attended, show the available options (repair/cancel)
# if repair is selected useUpdateVars will be 'true'
repair_dialog
fi
fi

10
pihole
View File

@ -107,11 +107,11 @@ updatePiholeFunc() {
fi
}
reconfigurePiholeFunc() {
repairPiholeFunc() {
if [ -n "${DOCKER_VERSION}" ]; then
unsupportedFunc
else
/etc/.pihole/automated\ install/basic-install.sh --reconfigure
/etc/.pihole/automated\ install/basic-install.sh --repair
exit 0;
fi
}
@ -476,7 +476,7 @@ Debugging Options:
Add '-c' or '--check-database' to include a Pi-hole database integrity check
Add '-a' to automatically upload the log to tricorder.pi-hole.net
-f, flush Flush the Pi-hole log
-r, reconfigure Reconfigure or Repair Pi-hole subsystems
-r, repair Repair Pi-hole subsystems
-t, tail [arg] View the live output of the Pi-hole log.
Add an optional argument to filter the log
(regular expressions are supported)
@ -533,7 +533,7 @@ case "${1}" in
"--allow-wild" | "allow-wild" ) need_root=0;;
"-f" | "flush" ) ;;
"-up" | "updatePihole" ) ;;
"-r" | "reconfigure" ) ;;
"-r" | "repair" ) ;;
"-l" | "logging" ) ;;
"uninstall" ) ;;
"enable" ) need_root=0;;
@ -576,7 +576,7 @@ case "${1}" in
"-d" | "debug" ) debugFunc "$@";;
"-f" | "flush" ) flushFunc "$@";;
"-up" | "updatePihole" ) updatePiholeFunc "$@";;
"-r" | "reconfigure" ) reconfigurePiholeFunc;;
"-r" | "repair" ) repairPiholeFunc;;
"-g" | "updateGravity" ) updateGravityFunc "$@";;
"-l" | "logging" ) piholeLogging "$@";;
"uninstall" ) uninstallFunc;;