Skip to content

Commit

Permalink
Add PIHOLE_VERSION as PIHOLE_DOCKER_TAG in the php environment instea…
Browse files Browse the repository at this point in the history
…d of injecting the version into the admin page's footer (#930)

Signed-off-by: Adam Warner <[email protected]>
  • Loading branch information
PromoFaux authored Oct 23, 2021
1 parent a39726d commit c0d05f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions bash_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" || \
Expand All @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit c0d05f2

Please sign in to comment.