mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-01-11 22:44:44 +00:00
Merge pull request #1581 from pi-hole/sqlite-dependency
Add "php5-sqlite" to dependencies
This commit is contained in:
commit
474ac4a15d
2 changed files with 34 additions and 29 deletions
|
@ -154,7 +154,12 @@ if command -v apt-get &> /dev/null; then
|
||||||
# fall back on the php5 packages
|
# fall back on the php5 packages
|
||||||
phpVer="php5"
|
phpVer="php5"
|
||||||
fi
|
fi
|
||||||
|
# We also need the correct version for `php-sqlite` (which differs across distros)
|
||||||
|
if ${PKG_MANAGER} install --dry-run ${phpVer}-sqlite3 > /dev/null 2>&1; then
|
||||||
|
phpSqlite="sqlite3"
|
||||||
|
else
|
||||||
|
phpSqlite="sqlite"
|
||||||
|
fi
|
||||||
# Since our install script is so large, we need several other programs to successfuly get a machine provisioned
|
# Since our install script is so large, we need several other programs to successfuly get a machine provisioned
|
||||||
# These programs are stored in an array so they can be looped through later
|
# These programs are stored in an array so they can be looped through later
|
||||||
INSTALLER_DEPS=(apt-utils dialog debconf dhcpcd5 git ${iproute_pkg} whiptail)
|
INSTALLER_DEPS=(apt-utils dialog debconf dhcpcd5 git ${iproute_pkg} whiptail)
|
||||||
|
@ -162,7 +167,7 @@ if command -v apt-get &> /dev/null; then
|
||||||
PIHOLE_DEPS=(bc cron curl dnsmasq dnsutils iputils-ping lsof netcat sudo unzip wget)
|
PIHOLE_DEPS=(bc cron curl dnsmasq dnsutils iputils-ping lsof netcat sudo unzip wget)
|
||||||
# The Web dashboard has some that also need to be installed
|
# The Web dashboard has some that also need to be installed
|
||||||
# It's useful to separate the two since our repos are also setup as "Core" code and "Web" code
|
# It's useful to separate the two since our repos are also setup as "Core" code and "Web" code
|
||||||
PIHOLE_WEB_DEPS=(lighttpd ${phpVer}-common ${phpVer}-cgi)
|
PIHOLE_WEB_DEPS=(lighttpd ${phpVer}-common ${phpVer}-cgi ${phpVer}-${phpSqlite})
|
||||||
# The Web server user,
|
# The Web server user,
|
||||||
LIGHTTPD_USER="www-data"
|
LIGHTTPD_USER="www-data"
|
||||||
# group,
|
# group,
|
||||||
|
@ -172,22 +177,22 @@ if command -v apt-get &> /dev/null; then
|
||||||
# The DNS server user
|
# The DNS server user
|
||||||
DNSMASQ_USER="dnsmasq"
|
DNSMASQ_USER="dnsmasq"
|
||||||
|
|
||||||
# A function to check...
|
# A function to check...
|
||||||
test_dpkg_lock() {
|
test_dpkg_lock() {
|
||||||
# An iterator used for counting loop iterations
|
# An iterator used for counting loop iterations
|
||||||
i=0
|
i=0
|
||||||
# fuser is a program to show which processes use the named files, sockets, or filesystems
|
# fuser is a program to show which processes use the named files, sockets, or filesystems
|
||||||
# So while the command is true
|
# So while the command is true
|
||||||
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
|
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
|
||||||
# Wait half a second
|
# Wait half a second
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
# and increase the iterator
|
# and increase the iterator
|
||||||
((i=i+1))
|
((i=i+1))
|
||||||
done
|
done
|
||||||
# Always return success, since we only return if there is no
|
# Always return success, since we only return if there is no
|
||||||
# lock (anymore)
|
# lock (anymore)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# If apt-get is not found, check for rpm to see if it's a Red Hat family OS
|
# If apt-get is not found, check for rpm to see if it's a Red Hat family OS
|
||||||
elif command -v rpm &> /dev/null; then
|
elif command -v rpm &> /dev/null; then
|
||||||
|
@ -204,7 +209,7 @@ elif command -v rpm &> /dev/null; then
|
||||||
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=(dialog git iproute net-tools newt procps-ng)
|
INSTALLER_DEPS=(dialog git iproute net-tools newt procps-ng)
|
||||||
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils nmap-ncat sudo unzip wget)
|
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils nmap-ncat sudo unzip wget)
|
||||||
PIHOLE_WEB_DEPS=(lighttpd lighttpd-fastcgi php php-common php-cli)
|
PIHOLE_WEB_DEPS=(lighttpd lighttpd-fastcgi php php-common php-cli php-pdo)
|
||||||
if ! grep -q 'Fedora' /etc/redhat-release; then
|
if ! grep -q 'Fedora' /etc/redhat-release; then
|
||||||
INSTALLER_DEPS=("${INSTALLER_DEPS[@]}" "epel-release");
|
INSTALLER_DEPS=("${INSTALLER_DEPS[@]}" "epel-release");
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -45,7 +45,7 @@ if [ -x "$(command -v rpm)" ]; then
|
||||||
PKG_MANAGER="yum"
|
PKG_MANAGER="yum"
|
||||||
fi
|
fi
|
||||||
PKG_REMOVE="${PKG_MANAGER} remove -y"
|
PKG_REMOVE="${PKG_MANAGER} remove -y"
|
||||||
PIHOLE_DEPS=( bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common git curl unzip wget findutils )
|
PIHOLE_DEPS=( bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-pdo git curl unzip wget findutils )
|
||||||
package_check() {
|
package_check() {
|
||||||
rpm -qa | grep ^$1- > /dev/null
|
rpm -qa | grep ^$1- > /dev/null
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ elif [ -x "$(command -v apt-get)" ]; then
|
||||||
# Debian Family
|
# Debian Family
|
||||||
PKG_MANAGER="apt-get"
|
PKG_MANAGER="apt-get"
|
||||||
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
|
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
|
||||||
PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common git curl unzip wget )
|
PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common php5-sqlite git curl unzip wget )
|
||||||
package_check() {
|
package_check() {
|
||||||
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue