mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
remove trailing whitespace
Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
parent
5584a9ce5d
commit
d26ea2b948
@ -172,7 +172,7 @@ if command -v apt-get &> /dev/null; then
|
|||||||
# group,
|
# group,
|
||||||
LIGHTTPD_GROUP="www-data"
|
LIGHTTPD_GROUP="www-data"
|
||||||
# and config file
|
# and config file
|
||||||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||||
|
|
||||||
# A function to check...
|
# A function to check...
|
||||||
test_dpkg_lock() {
|
test_dpkg_lock() {
|
||||||
@ -200,7 +200,7 @@ elif command -v rpm &> /dev/null; then
|
|||||||
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"
|
||||||
@ -213,7 +213,7 @@ elif command -v rpm &> /dev/null; then
|
|||||||
fi
|
fi
|
||||||
LIGHTTPD_USER="lighttpd"
|
LIGHTTPD_USER="lighttpd"
|
||||||
LIGHTTPD_GROUP="lighttpd"
|
LIGHTTPD_GROUP="lighttpd"
|
||||||
LIGHTTPD_CFG="lighttpd.conf.fedora"
|
LIGHTTPD_CFG="lighttpd.conf.fedora"
|
||||||
|
|
||||||
# If neither apt-get or rmp/dnf are found
|
# If neither apt-get or rmp/dnf are found
|
||||||
else
|
else
|
||||||
@ -1112,7 +1112,7 @@ installConfigs() {
|
|||||||
stop_service() {
|
stop_service() {
|
||||||
# Stop service passed in as argument.
|
# Stop service passed in as argument.
|
||||||
# Can softfail, as process may not be installed when this is called
|
# Can softfail, as process may not be installed when this is called
|
||||||
local str="Stopping ${1} service"
|
local str="Stopping ${1} service"
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne " ${INFO} ${str}..."
|
||||||
if command -v systemctl &> /dev/null; then
|
if command -v systemctl &> /dev/null; then
|
||||||
systemctl stop "${1}" &> /dev/null || true
|
systemctl stop "${1}" &> /dev/null || true
|
||||||
@ -1125,7 +1125,7 @@ stop_service() {
|
|||||||
# Start/Restart service passed in as argument
|
# Start/Restart service passed in as argument
|
||||||
start_service() {
|
start_service() {
|
||||||
# Local, named variables
|
# Local, named variables
|
||||||
local str="Starting ${1} service"
|
local str="Starting ${1} service"
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne " ${INFO} ${str}..."
|
||||||
# If systemctl exists,
|
# If systemctl exists,
|
||||||
if command -v systemctl &> /dev/null; then
|
if command -v systemctl &> /dev/null; then
|
||||||
@ -1142,7 +1142,7 @@ start_service() {
|
|||||||
# Enable service so that it will start with next reboot
|
# Enable service so that it will start with next reboot
|
||||||
enable_service() {
|
enable_service() {
|
||||||
# Local, named variables
|
# Local, named variables
|
||||||
local str="Enabling ${1} service to start on reboot"
|
local str="Enabling ${1} service to start on reboot"
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne " ${INFO} ${str}..."
|
||||||
# If systemctl exists,
|
# If systemctl exists,
|
||||||
if command -v systemctl &> /dev/null; then
|
if command -v systemctl &> /dev/null; then
|
||||||
@ -1159,7 +1159,7 @@ enable_service() {
|
|||||||
# Disable service so that it will not with next reboot
|
# Disable service so that it will not with next reboot
|
||||||
disable_service() {
|
disable_service() {
|
||||||
# Local, named variables
|
# Local, named variables
|
||||||
local str="Disabling ${1} service"
|
local str="Disabling ${1} service"
|
||||||
echo -ne " ${INFO} ${str}..."
|
echo -ne " ${INFO} ${str}..."
|
||||||
# If systemctl exists,
|
# If systemctl exists,
|
||||||
if command -v systemctl &> /dev/null; then
|
if command -v systemctl &> /dev/null; then
|
||||||
@ -1177,11 +1177,11 @@ check_service_active() {
|
|||||||
# If systemctl exists,
|
# If systemctl exists,
|
||||||
if command -v systemctl &> /dev/null; then
|
if command -v systemctl &> /dev/null; then
|
||||||
# use that to check the status of the service
|
# use that to check the status of the service
|
||||||
systemctl is-enabled "${1}" > /dev/null
|
systemctl is-enabled "${1}" > /dev/null
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
# fall back to service command
|
# fall back to service command
|
||||||
service "${1}" status > /dev/null
|
service "${1}" status > /dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1787,13 +1787,13 @@ FTLinstall() {
|
|||||||
local ftlBranch
|
local ftlBranch
|
||||||
local url
|
local url
|
||||||
local ftlBranch
|
local ftlBranch
|
||||||
|
|
||||||
if [[ -f "/etc/pihole/ftlbranch" ]];then
|
if [[ -f "/etc/pihole/ftlbranch" ]];then
|
||||||
ftlBranch=$(</etc/pihole/ftlbranch)
|
ftlBranch=$(</etc/pihole/ftlbranch)
|
||||||
else
|
else
|
||||||
ftlBranch="master"
|
ftlBranch="master"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine which version of FTL to download
|
# Determine which version of FTL to download
|
||||||
if [[ "${ftlBranch}" == "master" ]];then
|
if [[ "${ftlBranch}" == "master" ]];then
|
||||||
url="https://github.com/pi-hole/FTL/releases/download/${latesttag%$'\r'}"
|
url="https://github.com/pi-hole/FTL/releases/download/${latesttag%$'\r'}"
|
||||||
@ -1804,7 +1804,7 @@ FTLinstall() {
|
|||||||
# If the download worked,
|
# If the download worked,
|
||||||
if curl -sSL --fail "${url}/${binary}" -o "${binary}"; then
|
if curl -sSL --fail "${url}/${binary}" -o "${binary}"; then
|
||||||
# get sha1 of the binary we just downloaded for verification.
|
# get sha1 of the binary we just downloaded for verification.
|
||||||
curl -sSL --fail "${url}/${binary}.sha1" -o "${binary}.sha1"
|
curl -sSL --fail "${url}/${binary}.sha1" -o "${binary}.sha1"
|
||||||
|
|
||||||
# If we downloaded binary file (as opposed to text),
|
# If we downloaded binary file (as opposed to text),
|
||||||
if sha1sum --status --quiet -c "${binary}".sha1; then
|
if sha1sum --status --quiet -c "${binary}".sha1; then
|
||||||
@ -1826,7 +1826,7 @@ FTLinstall() {
|
|||||||
disable_service dnsmasq
|
disable_service dnsmasq
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
|
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
|
||||||
confdir="conf-dir=/etc/dnsmasq.d"
|
confdir="conf-dir=/etc/dnsmasq.d"
|
||||||
conffile="/etc/dnsmasq.conf"
|
conffile="/etc/dnsmasq.conf"
|
||||||
@ -1842,7 +1842,7 @@ FTLinstall() {
|
|||||||
echo -e "${OVER} ${CROSS} ${str}"
|
echo -e "${OVER} ${CROSS} ${str}"
|
||||||
echo -e " ${COL_LIGHT_RED}Error: Download of binary from Github failed${COL_NC}"
|
echo -e " ${COL_LIGHT_RED}Error: Download of binary from Github failed${COL_NC}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
popd > /dev/null || { echo "Unable to return to original directory after FTL binary download."; return 1; }
|
popd > /dev/null || { echo "Unable to return to original directory after FTL binary download."; return 1; }
|
||||||
@ -1926,9 +1926,9 @@ FTLdetect() {
|
|||||||
echo -e " ${INFO} Checking for existing FTL binary..."
|
echo -e " ${INFO} Checking for existing FTL binary..."
|
||||||
|
|
||||||
local ftlLoc=$(which pihole-FTL 2>/dev/null)
|
local ftlLoc=$(which pihole-FTL 2>/dev/null)
|
||||||
|
|
||||||
local ftlBranch
|
local ftlBranch
|
||||||
|
|
||||||
if [[ -f "/etc/pihole/ftlbranch" ]];then
|
if [[ -f "/etc/pihole/ftlbranch" ]];then
|
||||||
ftlBranch=$(</etc/pihole/ftlbranch)
|
ftlBranch=$(</etc/pihole/ftlbranch)
|
||||||
else
|
else
|
||||||
@ -2078,10 +2078,10 @@ main() {
|
|||||||
welcomeDialogs
|
welcomeDialogs
|
||||||
# Create directory for Pi-hole storage
|
# Create directory for Pi-hole storage
|
||||||
mkdir -p /etc/pihole/
|
mkdir -p /etc/pihole/
|
||||||
|
|
||||||
#Do we need to stop pihole-FTL or dnsmasq(if coming from an old install)?
|
#Do we need to stop pihole-FTL or dnsmasq(if coming from an old install)?
|
||||||
if [[ $(which pihole-FTL 2>/dev/null) ]]; then
|
if [[ $(which pihole-FTL 2>/dev/null) ]]; then
|
||||||
if pihole-FTL --resolver > /dev/null; then
|
if pihole-FTL --resolver > /dev/null; then
|
||||||
stop_service pihole-FTL
|
stop_service pihole-FTL
|
||||||
else
|
else
|
||||||
stop_service dnsmasq
|
stop_service dnsmasq
|
||||||
@ -2185,7 +2185,7 @@ main() {
|
|||||||
echo -e " ${INFO} Restarting services..."
|
echo -e " ${INFO} Restarting services..."
|
||||||
# Start services
|
# Start services
|
||||||
# Only start and enable dnsmasq if FTL does not have the --resolver switch
|
# Only start and enable dnsmasq if FTL does not have the --resolver switch
|
||||||
if ! pihole-FTL --resolver > /dev/null; then
|
if ! pihole-FTL --resolver > /dev/null; then
|
||||||
start_service dnsmasq
|
start_service dnsmasq
|
||||||
enable_service dnsmasq
|
enable_service dnsmasq
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user