mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Merge branches 'development' and 'fix/firewall_redux' of github.com:pi-hole/pi-hole into fix/firewall_redux
This commit is contained in:
commit
502c349b8b
2 changed files with 39 additions and 16 deletions
0
advanced/Scripts/version.sh
Normal file → Executable file
0
advanced/Scripts/version.sh
Normal file → Executable file
|
@ -97,9 +97,6 @@ if command -v apt-get &> /dev/null; then
|
||||||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||||
DNSMASQ_USER="dnsmasq"
|
DNSMASQ_USER="dnsmasq"
|
||||||
|
|
||||||
package_check_install() {
|
|
||||||
dpkg-query -W -f='${Status}' "${1}" 2>/dev/null | grep -c "ok installed" || ${PKG_INSTALL} "${1}"
|
|
||||||
}
|
|
||||||
elif command -v rpm &> /dev/null; then
|
elif command -v rpm &> /dev/null; then
|
||||||
# Fedora Family
|
# Fedora Family
|
||||||
if command -v dnf &> /dev/null; then
|
if command -v dnf &> /dev/null; then
|
||||||
|
@ -107,25 +104,22 @@ elif command -v rpm &> /dev/null; then
|
||||||
else
|
else
|
||||||
PKG_MANAGER="yum"
|
PKG_MANAGER="yum"
|
||||||
fi
|
fi
|
||||||
# Fedora and family update cache on every PKG_INSTALL call, no need for a separate update.
|
|
||||||
|
# Fedora and family update cache on every PKG_INSTALL call, no need for a separate update.
|
||||||
UPDATE_PKG_CACHE=":"
|
UPDATE_PKG_CACHE=":"
|
||||||
PKG_INSTALL="${PKG_MANAGER} install -y"
|
PKG_INSTALL="${PKG_MANAGER} install -y"
|
||||||
PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l"
|
PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l"
|
||||||
INSTALLER_DEPS=(git iproute net-tools newt procps-ng)
|
INSTALLER_DEPS=(git iproute net-tools newt procps-ng)
|
||||||
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq epel-release findutils lighttpd lighttpd-fastcgi nmap-ncat php php-common php-cli sudo unzip wget)
|
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils lighttpd lighttpd-fastcgi nmap-ncat php php-common php-cli sudo unzip wget)
|
||||||
|
|
||||||
if grep -q 'Fedora' /etc/redhat-release; then
|
if ! grep -q 'Fedora' /etc/redhat-release; then
|
||||||
remove_deps=(epel-release);
|
INSTALLER_DEPS=("${INSTALLER_DEPS[@]}" "epel-release");
|
||||||
PIHOLE_DEPS=( ${PIHOLE_DEPS[@]/$remove_deps} );
|
|
||||||
fi
|
fi
|
||||||
LIGHTTPD_USER="lighttpd"
|
LIGHTTPD_USER="lighttpd"
|
||||||
LIGHTTPD_GROUP="lighttpd"
|
LIGHTTPD_GROUP="lighttpd"
|
||||||
LIGHTTPD_CFG="lighttpd.conf.fedora"
|
LIGHTTPD_CFG="lighttpd.conf.fedora"
|
||||||
DNSMASQ_USER="nobody"
|
DNSMASQ_USER="nobody"
|
||||||
|
|
||||||
package_check_install() {
|
|
||||||
rpm -qa | grep ^"${1}"- > /dev/null || ${PKG_INSTALL} "${1}"
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
echo "OS distribution not supported"
|
echo "OS distribution not supported"
|
||||||
exit
|
exit
|
||||||
|
@ -548,7 +542,7 @@ setLogging() {
|
||||||
local LogChoices
|
local LogChoices
|
||||||
|
|
||||||
LogToggleCommand=(whiptail --separate-output --radiolist "Do you want to log queries?\n (Disabling will render graphs on the Admin page useless):" ${r} ${c} 6)
|
LogToggleCommand=(whiptail --separate-output --radiolist "Do you want to log queries?\n (Disabling will render graphs on the Admin page useless):" ${r} ${c} 6)
|
||||||
LogChooseOptions=("On (Reccomended)" "" on
|
LogChooseOptions=("On (Recommended)" "" on
|
||||||
Off "" off)
|
Off "" off)
|
||||||
LogChoices=$("${LogToggleCommand[@]}" "${LogChooseOptions[@]}" 2>&1 >/dev/tty) || (echo "::: Cancel selected. Exiting..." && exit 1)
|
LogChoices=$("${LogToggleCommand[@]}" "${LogChooseOptions[@]}" 2>&1 >/dev/tty) || (echo "::: Cancel selected. Exiting..." && exit 1)
|
||||||
case ${LogChoices} in
|
case ${LogChoices} in
|
||||||
|
@ -751,16 +745,45 @@ install_dependent_packages() {
|
||||||
# Install packages passed in via argument array
|
# Install packages passed in via argument array
|
||||||
# No spinner - conflicts with set -e
|
# No spinner - conflicts with set -e
|
||||||
declare -a argArray1=("${!1}")
|
declare -a argArray1=("${!1}")
|
||||||
|
declare -a installArray
|
||||||
|
|
||||||
|
# Debian based package install - debconf will download the entire package list
|
||||||
|
# so we just create an array of packages not currently installed to cut down on the
|
||||||
|
# amount of download traffic.
|
||||||
|
# NOTE: We may be able to use this installArray in the future to create a list of package that were
|
||||||
|
# installed by us, and remove only the installed packages, and not the entire list.
|
||||||
if command -v debconf-apt-progress &> /dev/null; then
|
if command -v debconf-apt-progress &> /dev/null; then
|
||||||
debconf-apt-progress -- ${PKG_INSTALL} "${argArray1[@]}"
|
|
||||||
else
|
|
||||||
for i in "${argArray1[@]}"; do
|
for i in "${argArray1[@]}"; do
|
||||||
echo -n "::: Checking for $i..."
|
echo -n "::: Checking for $i..."
|
||||||
package_check_install "${i}" &> /dev/null
|
if dpkg-query -W -f='${Status}' "${i}" 2>/dev/null | grep "ok installed" &> /dev/null; then
|
||||||
echo " installed!"
|
echo " installed!"
|
||||||
|
else
|
||||||
|
echo " added to install list!"
|
||||||
|
installArray+=("${i}")
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
if [[ ${#installArray[@]} -gt 0 ]]; then
|
||||||
|
debconf-apt-progress -- ${PKG_INSTALL} "${installArray[@]}"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#Fedora/CentOS
|
||||||
|
for i in "${argArray1[@]}"; do
|
||||||
|
echo -n "::: Checking for $i..."
|
||||||
|
if ${PKG_MANAGER} -q list installed "${i}" &> /dev/null; then
|
||||||
|
echo " installed!"
|
||||||
|
else
|
||||||
|
echo " added to install list!"
|
||||||
|
installArray+=("${i}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ ${#installArray[@]} -gt 0 ]]; then
|
||||||
|
${PKG_INSTALL} "${installArray[@]}" &> /dev/null
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateLogFile() {
|
CreateLogFile() {
|
||||||
|
|
Loading…
Reference in a new issue