1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Convert multiline echos to individual echo statements so they don't lead with different amounts of space.

Signed-off-by: Dan Schaper <dan.schaper@pihole.net>
This commit is contained in:
Dan Schaper 2018-07-06 21:29:20 -07:00
parent a323b126e5
commit 9dba9fb366
No known key found for this signature in database
GPG Key ID: B4FF14C01CC08DC0

View File

@ -492,27 +492,27 @@ verifyFreeDiskSpace() {
# If the existing space is not an integer, # If the existing space is not an integer,
if ! [[ "${existing_free_kilobytes}" =~ ^([0-9])+$ ]]; then if ! [[ "${existing_free_kilobytes}" =~ ^([0-9])+$ ]]; then
# show an error that we can't determine the free space # show an error that we can't determine the free space
echo -e " ${CROSS} ${str} echo -e " ${CROSS} ${str}"
Unknown free disk space! echo -e " ${INFO} Unknown free disk space!"
We were unable to determine available free disk space on this system. echo -e " ${INFO} We were unable to determine available free disk space on this system."
You may override this check, however, it is not recommended echo -e " ${INFO} You may override this check, however, it is not recommended"
The option '${COL_LIGHT_RED}--i_do_not_follow_recommendations${COL_NC}' can override this echo -e " ${INFO} The option '${COL_LIGHT_RED}--i_do_not_follow_recommendations${COL_NC}' can override this"
e.g: curl -L https://install.pi-hole.net | bash /dev/stdin ${COL_LIGHT_RED}<option>${COL_NC}" echo -e " ${INFO} e.g: curl -L https://install.pi-hole.net | bash /dev/stdin ${COL_LIGHT_RED}<option>${COL_NC}"
# exit with an error code # exit with an error code
exit 1 exit 1
# If there is insufficient free disk space, # If there is insufficient free disk space,
elif [[ "${existing_free_kilobytes}" -lt "${required_free_kilobytes}" ]]; then elif [[ "${existing_free_kilobytes}" -lt "${required_free_kilobytes}" ]]; then
# show an error message # show an error message
echo -e " ${CROSS} ${str} echo -e " ${CROSS} ${str}"
Your system disk appears to only have ${existing_free_kilobytes} KB free echo -e " ${INFO} Your system disk appears to only have ${existing_free_kilobytes} KB free"
It is recommended to have a minimum of ${required_free_kilobytes} KB to run the Pi-hole" echo -e " ${INFO} It is recommended to have a minimum of ${required_free_kilobytes} KB to run the Pi-hole"
# if the vcgencmd command exists, # if the vcgencmd command exists,
if command -v vcgencmd &> /dev/null; then if command -v vcgencmd &> /dev/null; then
# it's probably a Raspbian install, so show a message about expanding the filesystem # it's probably a Raspbian install, so show a message about expanding the filesystem
echo " If this is a new install you may need to expand your disk echo -e " ${INFO} If this is a new install you may need to expand your disk"
Run 'sudo raspi-config', and choose the 'expand file system' option echo -e " ${INFO} Run 'sudo raspi-config', and choose the 'expand file system' option"
After rebooting, run this installation again echo -e " ${INFO} After rebooting, run this installation again"
e.g: curl -L https://install.pi-hole.net | bash" echo -e " ${INFO} e.g: curl -L https://install.pi-hole.net | bash"
fi fi
# Show there is not enough free space # Show there is not enough free space
echo -e "\\n ${COL_LIGHT_RED}Insufficient free space, exiting...${COL_NC}" echo -e "\\n ${COL_LIGHT_RED}Insufficient free space, exiting...${COL_NC}"
@ -2168,9 +2168,9 @@ get_binary_name() {
else else
# Something else - we try to use 32bit executable and warn the user # Something else - we try to use 32bit executable and warn the user
if [[ ! "${machine}" == "i686" ]]; then if [[ ! "${machine}" == "i686" ]]; then
echo -e "${OVER} ${CROSS} ${str}... echo -e "${OVER} ${CROSS} ${str}..."
${COL_LIGHT_RED}Not able to detect architecture (unknown: ${machine}), trying 32bit executable${COL_NC} echo -e " ${INFO} ${COL_LIGHT_RED}Not able to detect architecture (unknown: ${machine}), trying 32bit executable${COL_NC}"
Contact Pi-hole Support if you experience issues (e.g: FTL not running)" echo -e " ${INFO} Contact Pi-hole Support if you experience issues (e.g: FTL not running)"
else else
echo -e "${OVER} ${TICK} Detected 32bit (i686) architecture" echo -e "${OVER} ${TICK} Detected 32bit (i686) architecture"
fi fi
@ -2307,11 +2307,11 @@ main() {
# Otherwise, # Otherwise,
else else
# They do not have enough privileges, so let the user know # They do not have enough privileges, so let the user know
echo -e " ${CROSS} ${str} echo -e " ${CROSS} ${str}"
${COL_LIGHT_RED}Script called with non-root privileges${COL_NC} echo -e " ${INFO} ${COL_LIGHT_RED}Script called with non-root privileges${COL_NC}"
The Pi-hole requires elevated privileges to install and run echo -e " ${INFO} The Pi-hole requires elevated privileges to install and run"
Please check the installer for any concerns regarding this requirement echo -e " ${INFO} Please check the installer for any concerns regarding this requirement"
Make sure to download this script from a trusted source\\n" echo -e " ${INFO} Make sure to download this script from a trusted source\\n"
echo -ne " ${INFO} Sudo utility check" echo -ne " ${INFO} Sudo utility check"
# If the sudo command exists, # If the sudo command exists,
@ -2323,9 +2323,9 @@ main() {
# Otherwise, # Otherwise,
else else
# Let them know they need to run it as root # Let them know they need to run it as root
echo -e "${OVER} ${CROSS} Sudo utility check echo -e "${OVER} ${CROSS} Sudo utility check"
Sudo is needed for the Web Interface to run pihole commands\\n echo -e " ${INFO} Sudo is needed for the Web Interface to run pihole commands\\n"
${COL_LIGHT_RED}Please re-run this installer as root${COL_NC}" echo -e " ${INFO} ${COL_LIGHT_RED}Please re-run this installer as root${COL_NC}"
exit 1 exit 1
fi fi
fi fi
@ -2475,8 +2475,8 @@ main() {
# If there is a password, # If there is a password,
if (( ${#pw} > 0 )) ; then if (( ${#pw} > 0 )) ; then
# display the password # display the password
echo -e " ${INFO} Web Interface password: ${COL_LIGHT_GREEN}${pw}${COL_NC} echo -e " ${INFO} Web Interface password: ${COL_LIGHT_GREEN}${pw}${COL_NC}"
This can be changed using 'pihole -a -p'\\n" echo -e " ${INFO} This can be changed using 'pihole -a -p'\\n"
fi fi
fi fi
@ -2484,14 +2484,14 @@ main() {
if [[ "${useUpdateVars}" == false ]]; then if [[ "${useUpdateVars}" == false ]]; then
# If the Web interface was installed, # If the Web interface was installed,
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
echo -e " View the web interface at http://pi.hole/admin or http://${IPV4_ADDRESS%/*}/admin" echo -e " ${INFO} View the web interface at http://pi.hole/admin or http://${IPV4_ADDRESS%/*}/admin"
echo "" echo ""
fi fi
# Explain to the user how to use Pi-hole as their DNS server # Explain to the user how to use Pi-hole as their DNS server
echo " You may now configure your devices to use the Pi-hole as their DNS server" echo -e " ${INFO} You may now configure your devices to use the Pi-hole as their DNS server"
[[ -n "${IPV4_ADDRESS%/*}" ]] && echo -e " ${INFO} Pi-hole DNS (IPv4): ${IPV4_ADDRESS%/*}" [[ -n "${IPV4_ADDRESS%/*}" ]] && echo -e " ${INFO} Pi-hole DNS (IPv4): ${IPV4_ADDRESS%/*}"
[[ -n "${IPV6_ADDRESS}" ]] && echo -e " ${INFO} Pi-hole DNS (IPv6): ${IPV6_ADDRESS}" [[ -n "${IPV6_ADDRESS}" ]] && echo -e " ${INFO} Pi-hole DNS (IPv6): ${IPV6_ADDRESS}"
echo -e " If you set a new IP address, please restart the server running the Pi-hole" echo -e " ${INFO} If you set a new IP address, please restart the server running the Pi-hole"
# #
INSTALL_TYPE="Installation" INSTALL_TYPE="Installation"
else else