Add PIHOLE_VERSION as PIHOLE_DOCKER_TAG in the php environment instead of injecting the version into the admin page's footer (#930)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
a39726d183
commit
c0d05f291d
|
@ -202,6 +202,7 @@ setup_php_env() {
|
|||
local corshosts_line="\t\t\t\"CORS_HOSTS\" => \"${CORS_HOSTS}\","
|
||||
local serverip_line="\t\t\t\"ServerIP\" => \"${ServerIP}\","
|
||||
local php_error_line="\t\t\t\"PHP_ERROR_LOG\" => \"${PHP_ERROR_LOG}\","
|
||||
local pihole_docker_tag_line="\t\t\t\"PIHOLE_DOCKER_TAG\" => \"${PIHOLE_VERSION}\","
|
||||
|
||||
# idempotent line additions
|
||||
grep -qP "$vhost_line" "$PHP_ENV_CONFIG" || \
|
||||
|
@ -212,6 +213,8 @@ setup_php_env() {
|
|||
sed -i "/bin-environment/ a\\${serverip_line}" "$PHP_ENV_CONFIG"
|
||||
grep -qP "$php_error_line" "$PHP_ENV_CONFIG" || \
|
||||
sed -i "/bin-environment/ a\\${php_error_line}" "$PHP_ENV_CONFIG"
|
||||
grep -qP "$pihole_docker_tag_line" "$PHP_ENV_CONFIG" || \
|
||||
sed -i "/bin-environment/ a\\${pihole_docker_tag_line}" "$PHP_ENV_CONFIG"
|
||||
|
||||
echo "Added ENV to php:"
|
||||
grep -E '(VIRTUAL_HOST|CORS_HOSTS|ServerIP|PHP_ERROR_LOG)' "$PHP_ENV_CONFIG"
|
||||
|
|
|
@ -88,10 +88,6 @@ sed -i $'s/)\s*uninstallFunc/) unsupportedFunc/g' /usr/local/bin/pihole
|
|||
# Inject a message into the debug scripts Operating System section to indicate that the debug log comes from a Docker system.
|
||||
sed -i $'s/echo_current_diagnostic "Operating system"/echo_current_diagnostic "Operating system"\\\n log_write "${INFO} Pi-hole Docker Container: ${PIHOLE_VERSION:-PIHOLE_VERSION is unset}"/g' /opt/pihole/piholeDebug.sh
|
||||
|
||||
# Inject container tag into web interface footer...
|
||||
sed -i $"s/<ul class=\"list-unstyled\">/<ul class=\"list-unstyled\">\\n<strong><li>Docker Tag<\/strong> ${PIHOLE_VERSION}<\/li>/g" /var/www/html/admin/scripts/pi-hole/php/footer.php
|
||||
sed -i $"s/<ul class=\"list-inline\">/<strong>Docker Tag<\/strong> ${PIHOLE_VERSION}\\n<ul class=\"list-inline\">/g" /var/www/html/admin/scripts/pi-hole/php/footer.php
|
||||
|
||||
touch /.piholeFirstBoot
|
||||
|
||||
echo 'Docker install successful'
|
Loading…
Reference in New Issue