Merge pull request #2287 from pi-hole/feature/clean_comments

Remove empty comment lines in basic-install.sh
This commit is contained in:
Dan Schaper 2018-07-20 11:37:15 -07:00 committed by GitHub
commit 1fc3ec9029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1015,20 +1015,14 @@ setDNS() {
if [[ ! "${PIHOLE_DNS_1}" ]]; then if [[ ! "${PIHOLE_DNS_1}" ]]; then
# and second upstream servers do not exist # and second upstream servers do not exist
if [[ ! "${PIHOLE_DNS_2}" ]]; then if [[ ! "${PIHOLE_DNS_2}" ]]; then
#
prePopulate="" prePopulate=""
# Otherwise, # Otherwise,
else else
#
prePopulate=", ${PIHOLE_DNS_2}" prePopulate=", ${PIHOLE_DNS_2}"
fi fi
#
elif [[ "${PIHOLE_DNS_1}" ]] && [[ ! "${PIHOLE_DNS_2}" ]]; then elif [[ "${PIHOLE_DNS_1}" ]] && [[ ! "${PIHOLE_DNS_2}" ]]; then
#
prePopulate="${PIHOLE_DNS_1}" prePopulate="${PIHOLE_DNS_1}"
#
elif [[ "${PIHOLE_DNS_1}" ]] && [[ "${PIHOLE_DNS_2}" ]]; then elif [[ "${PIHOLE_DNS_1}" ]] && [[ "${PIHOLE_DNS_2}" ]]; then
#
prePopulate="${PIHOLE_DNS_1}, ${PIHOLE_DNS_2}" prePopulate="${PIHOLE_DNS_1}, ${PIHOLE_DNS_2}"
fi fi
@ -1563,13 +1557,10 @@ notify_package_updates_available() {
updatesToInstall=$(eval "${PKG_COUNT}") updatesToInstall=$(eval "${PKG_COUNT}")
if [[ -d "/lib/modules/$(uname -r)" ]]; then if [[ -d "/lib/modules/$(uname -r)" ]]; then
#
if [[ "${updatesToInstall}" -eq 0 ]]; then if [[ "${updatesToInstall}" -eq 0 ]]; then
#
echo -e "${OVER} ${TICK} ${str}... up to date!" echo -e "${OVER} ${TICK} ${str}... up to date!"
echo "" echo ""
else else
#
echo -e "${OVER} ${TICK} ${str}... ${updatesToInstall} updates available" echo -e "${OVER} ${TICK} ${str}... ${updatesToInstall} updates available"
echo -e " ${INFO} ${COL_LIGHT_GREEN}It is recommended to update your OS after installing the Pi-hole! ${COL_NC}" echo -e " ${INFO} ${COL_LIGHT_GREEN}It is recommended to update your OS after installing the Pi-hole! ${COL_NC}"
echo "" echo ""
@ -1610,45 +1601,33 @@ install_dependent_packages() {
# For each package, # For each package,
for i in "${argArray1[@]}"; do for i in "${argArray1[@]}"; do
echo -ne " ${INFO} Checking for $i..." echo -ne " ${INFO} Checking for $i..."
#
if dpkg-query -W -f='${Status}' "${i}" 2>/dev/null | grep "ok installed" &> /dev/null; then if dpkg-query -W -f='${Status}' "${i}" 2>/dev/null | grep "ok installed" &> /dev/null; then
#
echo -e "${OVER} ${TICK} Checking for $i" echo -e "${OVER} ${TICK} Checking for $i"
else else
#
echo -e "${OVER} ${INFO} Checking for $i (will be installed)" echo -e "${OVER} ${INFO} Checking for $i (will be installed)"
#
installArray+=("${i}") installArray+=("${i}")
fi fi
done done
#
if [[ "${#installArray[@]}" -gt 0 ]]; then if [[ "${#installArray[@]}" -gt 0 ]]; then
#
test_dpkg_lock test_dpkg_lock
#
debconf-apt-progress -- "${PKG_INSTALL[@]}" "${installArray[@]}" debconf-apt-progress -- "${PKG_INSTALL[@]}" "${installArray[@]}"
return return
fi fi
echo "" echo ""
#
return 0 return 0
fi fi
# Install Fedora/CentOS packages # Install Fedora/CentOS packages
for i in "${argArray1[@]}"; do for i in "${argArray1[@]}"; do
echo -ne " ${INFO} Checking for $i..." echo -ne " ${INFO} Checking for $i..."
#
if ${PKG_MANAGER} -q list installed "${i}" &> /dev/null; then if ${PKG_MANAGER} -q list installed "${i}" &> /dev/null; then
echo -e "${OVER} ${TICK} Checking for $i" echo -e "${OVER} ${TICK} Checking for $i"
else else
echo -e "${OVER} ${INFO} Checking for $i (will be installed)" echo -e "${OVER} ${INFO} Checking for $i (will be installed)"
#
installArray+=("${i}") installArray+=("${i}")
fi fi
done done
#
if [[ "${#installArray[@]}" -gt 0 ]]; then if [[ "${#installArray[@]}" -gt 0 ]]; then
#
"${PKG_INSTALL[@]}" "${installArray[@]}" &> /dev/null "${PKG_INSTALL[@]}" "${installArray[@]}" &> /dev/null
return return
fi fi
@ -2606,7 +2585,6 @@ main() {
/opt/pihole/updatecheck.sh /opt/pihole/updatecheck.sh
/opt/pihole/updatecheck.sh x remote /opt/pihole/updatecheck.sh x remote
#
if [[ "${useUpdateVars}" == false ]]; then if [[ "${useUpdateVars}" == false ]]; then
displayFinalMessage "${pw}" displayFinalMessage "${pw}"
fi fi
@ -2621,7 +2599,6 @@ main() {
fi fi
fi fi
#
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
@ -2633,10 +2610,8 @@ main() {
[[ -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 " ${INFO} 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
#
INSTALL_TYPE="Update" INSTALL_TYPE="Update"
fi fi
@ -2650,7 +2625,6 @@ main() {
fi fi
} }
#
if [[ "${PH_TEST}" != true ]] ; then if [[ "${PH_TEST}" != true ]] ; then
main "$@" main "$@"
fi fi