mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 22:00:17 +00:00
commit
b710e107d6
1 changed files with 4 additions and 19 deletions
|
@ -94,24 +94,9 @@ if [ -z "${USER}" ]; then
|
||||||
USER="$(id -un)"
|
USER="$(id -un)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# whiptail dialog dimensions: 20 rows and 70 chars width assures to fit on small screens and is known to hold all content.
|
||||||
# Check if we are running on a real terminal and find the rows and columns
|
r=20
|
||||||
# If there is no real terminal, we will default to 80x24
|
c=70
|
||||||
if [ -t 0 ] ; then
|
|
||||||
screen_size=$(stty size)
|
|
||||||
else
|
|
||||||
screen_size="24 80"
|
|
||||||
fi
|
|
||||||
# Determine terminal rows and columns by parsing screen_size
|
|
||||||
printf -v rows '%d' "${screen_size%% *}"
|
|
||||||
printf -v columns '%d' "${screen_size##* }"
|
|
||||||
|
|
||||||
# Divide by two so the dialogs take up half of the screen, which looks nice.
|
|
||||||
r=$(( rows / 2 ))
|
|
||||||
c=$(( columns / 2 ))
|
|
||||||
# Unless the screen is tiny
|
|
||||||
r=$(( r < 20 ? 20 : r ))
|
|
||||||
c=$(( c < 70 ? 70 : c ))
|
|
||||||
|
|
||||||
######## Undocumented Flags. Shhh ########
|
######## Undocumented Flags. Shhh ########
|
||||||
# These are undocumented flags; some of which we can use when repairing an installation
|
# These are undocumented flags; some of which we can use when repairing an installation
|
||||||
|
@ -2056,7 +2041,7 @@ update_dialogs() {
|
||||||
strAdd="You will be updated to the latest version."
|
strAdd="You will be updated to the latest version."
|
||||||
fi
|
fi
|
||||||
opt2a="Reconfigure"
|
opt2a="Reconfigure"
|
||||||
opt2b="This will reset your Pi-hole and allow you to enter new settings."
|
opt2b="Resets Pi-hole and allows re-selecting settings."
|
||||||
|
|
||||||
# Display the information to the user
|
# Display the information to the user
|
||||||
UpdateCmd=$(whiptail --title "Existing Install Detected!" --menu "\\n\\nWe have detected an existing install.\\n\\nPlease choose from the following options: \\n($strAdd)" "${r}" "${c}" 2 \
|
UpdateCmd=$(whiptail --title "Existing Install Detected!" --menu "\\n\\nWe have detected an existing install.\\n\\nPlease choose from the following options: \\n($strAdd)" "${r}" "${c}" 2 \
|
||||||
|
|
Loading…
Reference in a new issue