mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-19 05:40:13 +00:00
Standardize function declaration
There were no fewer than three styles of function declaration going on in these files, so I attempted to standardize them to the typical myfucn() { } style.
This commit is contained in:
parent
16e4f79f09
commit
28eeaf201b
9 changed files with 55 additions and 63 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#/usr/bin/env bash
|
||||
# Pi-hole: A black hole for Internet advertisements
|
||||
# (c) 2015, 2016 by Jacob Salmela
|
||||
# Network-wide ad blocking via your Raspberry Pi
|
||||
|
@ -61,11 +61,11 @@ else
|
|||
fi
|
||||
|
||||
### Private functions exist here ###
|
||||
function log_write {
|
||||
log_write() {
|
||||
echo "$1" >> "${DEBUG_LOG}"
|
||||
}
|
||||
|
||||
function version_check {
|
||||
version_check() {
|
||||
log_write "############################################################"
|
||||
log_write "########## Installed Versions ##########"
|
||||
log_write "############################################################"
|
||||
|
@ -83,7 +83,7 @@ function version_check {
|
|||
php_ver="$(php -v |& head -n1)" && log_write "${php_ver}" || log_write "PHP not installed."
|
||||
}
|
||||
|
||||
function distro_check {
|
||||
distro_check() {
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
echo "######## Installed OS Distribution #########" >> ${DEBUG_LOG}
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
|
@ -96,7 +96,7 @@ function distro_check {
|
|||
echo >> ${DEBUG_LOG}
|
||||
}
|
||||
|
||||
function ip_check {
|
||||
ip_check() {
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
echo "######## IP Address Information #########" >> ${DEBUG_LOG}
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
|
@ -166,7 +166,7 @@ function ip_check {
|
|||
echo >> ${DEBUG_LOG}
|
||||
}
|
||||
|
||||
function hostnameCheck {
|
||||
hostnameCheck() {
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
echo "######## Hostname Information #########" >> ${DEBUG_LOG}
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
|
@ -188,7 +188,7 @@ function hostnameCheck {
|
|||
fi
|
||||
}
|
||||
|
||||
function portCheck {
|
||||
portCheck() {
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
echo "######## Open Port Information #########" >> ${DEBUG_LOG}
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
|
@ -200,7 +200,7 @@ function portCheck {
|
|||
echo >> ${DEBUG_LOG}
|
||||
}
|
||||
|
||||
function testResolver {
|
||||
testResolver() {
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
echo "############ Resolver Functions Check ############" >> ${DEBUG_LOG}
|
||||
echo "############################################################" >> ${DEBUG_LOG}
|
||||
|
@ -262,7 +262,7 @@ function testResolver {
|
|||
echo >> ${DEBUG_LOG}
|
||||
}
|
||||
|
||||
function checkProcesses {
|
||||
checkProcesses() {
|
||||
echo "#######################################" >> ${DEBUG_LOG}
|
||||
echo "########### Processes Check ###########" >> ${DEBUG_LOG}
|
||||
echo "#######################################" >> ${DEBUG_LOG}
|
||||
|
@ -279,7 +279,7 @@ function checkProcesses {
|
|||
echo >> ${DEBUG_LOG}
|
||||
}
|
||||
|
||||
function debugLighttpd {
|
||||
debugLighttpd() {
|
||||
echo "::: Writing lighttpd to debug log..."
|
||||
echo "#######################################" >> ${DEBUG_LOG}
|
||||
echo "############ lighttpd.conf ############" >> ${DEBUG_LOG}
|
||||
|
@ -420,7 +420,7 @@ fi
|
|||
|
||||
|
||||
# Continuously append the pihole.log file to the pihole_debug.log file
|
||||
function dumpPiHoleLog {
|
||||
dumpPiHoleLog() {
|
||||
trap '{ echo -e "\n::: Finishing debug write from interrupt... Quitting!" ; exit 1; }' INT
|
||||
echo -e "::: Writing current Pi-hole traffic to debug log...\n:::\tTry loading any/all sites that you are having trouble with now... \n:::\t(Press ctrl+C to finish)"
|
||||
echo "#######################################" >> ${DEBUG_LOG}
|
||||
|
@ -439,7 +439,7 @@ function dumpPiHoleLog {
|
|||
}
|
||||
|
||||
# Anything to be done after capturing of pihole.log terminates
|
||||
function finalWork {
|
||||
finalWork() {
|
||||
echo "::: Finshed debugging!"
|
||||
echo "::: The debug log can be uploaded to Termbin.com for easier sharing."
|
||||
read -r -p "::: Would you like to upload the log? [y/N] " response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue