mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Prototype version_check, add helper functions for logging and echo.
This commit is contained in:
parent
01f17f9cbb
commit
fb70fd77e8
1 changed files with 12 additions and 8 deletions
|
@ -56,20 +56,24 @@ header_write() {
|
||||||
echo "" >> "${DEBUG_LOG}"
|
echo "" >> "${DEBUG_LOG}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log_echo() {
|
||||||
|
echo "::: ${1}"
|
||||||
|
log_write "${1}"
|
||||||
|
}
|
||||||
|
|
||||||
version_check() {
|
version_check() {
|
||||||
header_write "Installed Package Versions"
|
header_write "Installed Package Versions"
|
||||||
echo "::: Detecting Pi-hole installed versions."
|
echo "::: Detecting Pi-hole installed versions."
|
||||||
|
|
||||||
pi_hole_ver="$(cd /etc/.pihole/ && git describe --tags --abbrev=0)" \
|
pi_hole_ver="$(cd /etc/.pihole/ && git describe --tags --abbrev=0)" \
|
||||||
&& log_write "Pi-hole Version: $pi_hole_ver" || log_write "Pi-hole git repository not detected."
|
&& log_echo "Pi-hole: $pi_hole_ver" || log_echo "Pi-hole git repository not detected."
|
||||||
admin_ver="$(cd /var/www/html/admin && git describe --tags --abbrev=0)" \
|
admin_ver="$(cd /var/www/html/admin && git describe --tags --abbrev=0)" \
|
||||||
&& log_write "WebUI Version: $admin_ver" || log_write "Pi-hole Admin Pages git repository not detected."
|
&& log_echo "WebUI: $admin_ver" || log_echo "Pi-hole Admin Pages git repository not detected."
|
||||||
|
light_ver="$(lighttpd -v |& head -n1 | cut -d " " -f1)" \
|
||||||
echo "::: Writing lighttpd version to logfile."
|
&& log_echo "${light_ver}" || log_echo "lighttpd not installed."
|
||||||
light_ver="$(lighttpd -v |& head -n1)" && log_write "${light_ver}" || log_write "lighttpd not installed."
|
php_ver="$(php -v |& head -n1)" \
|
||||||
|
&& log_echo "${php_ver}" || log_echo "PHP not installed."
|
||||||
echo "::: Writing PHP version to logfile."
|
echo ":::"
|
||||||
php_ver="$(php -v |& head -n1)" && log_write "${php_ver}" || log_write "PHP not installed."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
files_check() {
|
files_check() {
|
||||||
|
|
Loading…
Reference in a new issue