mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Consistency and standards basic-install start.
This commit is contained in:
parent
035e4bf727
commit
7740e4268c
1 changed files with 94 additions and 90 deletions
|
@ -96,6 +96,7 @@ if [[ $(command -v apt-get) ]]; then
|
|||
LIGHTTPD_GROUP="www-data"
|
||||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||
DNSMASQ_USER="dnsmasq"
|
||||
|
||||
package_check_install() {
|
||||
dpkg-query -W -f='${Status}' "${1}" 2>/dev/null | grep -c "ok installed" || ${PKG_INSTALL} "${1}"
|
||||
}
|
||||
|
@ -113,6 +114,7 @@ elif [ $(command -v rpm) ]; then
|
|||
PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l"
|
||||
INSTALLER_DEPS=( iproute net-tools procps-ng newt git )
|
||||
PIHOLE_DEPS=( epel-release bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-cli php curl unzip wget findutils cronie sudo nmap-ncat )
|
||||
|
||||
if grep -q 'Fedora' /etc/redhat-release; then
|
||||
remove_deps=(epel-release);
|
||||
PIHOLE_DEPS=( ${PIHOLE_DEPS[@]/$remove_deps} );
|
||||
|
@ -121,6 +123,7 @@ elif [ $(command -v rpm) ]; then
|
|||
LIGHTTPD_GROUP="lighttpd"
|
||||
LIGHTTPD_CFG="lighttpd.conf.fedora"
|
||||
DNSMASQ_USER="nobody"
|
||||
|
||||
package_check_install() {
|
||||
rpm -qa | grep ^"${1}"- > /dev/null || ${PKG_INSTALL} "${1}"
|
||||
}
|
||||
|
@ -134,6 +137,7 @@ spinner() {
|
|||
local pid=$1
|
||||
local delay=0.50
|
||||
local spinstr='/-\|'
|
||||
|
||||
while [ "$(ps a | awk '{print $1}' | grep "${pid}")" ]; do
|
||||
local temp=${spinstr#?}
|
||||
printf " [%c] " "${spinstr}"
|
||||
|
@ -148,7 +152,7 @@ is_repo() {
|
|||
# Use git to check if directory is currently under VCS
|
||||
echo -n "::: Checking $1 is a repo..."
|
||||
cd "${1}" &> /dev/null || return 1
|
||||
git status &> /dev/null && echo " OK!"; return 0 || echo " not found!"; return 1
|
||||
git status &> /dev/null && (echo " OK!"; true) || (echo " not found!"; false)
|
||||
}
|
||||
|
||||
make_repo() {
|
||||
|
|
Loading…
Reference in a new issue