Explorar el Código

Merge pull request #1897 from jaapmarcus/fix/keep-awstats-tpl-on-upgrade

Keep changes made to awstats.tpl on upgrade
Raphael Schneeberger hace 4 años
padre
commit
0abfedd8ee
Se han modificado 2 ficheros con 9 adiciones y 0 borrados
  1. 1 0
      CHANGELOG.md
  2. 8 0
      bin/v-update-web-templates

+ 1 - 0
CHANGELOG.md

@@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
 - Fixed an issue where the "Saved confirmation" was not set due to a redirect #1879
 - Fixed an issue where the "Saved confirmation" was not set due to a redirect #1879
 - Increased minimal memory requirements for ClamD / ClamAV.  #1840
 - Increased minimal memory requirements for ClamD / ClamAV.  #1840
 - Restore of backup did not rebuild the "Forced SSL" and "HSTS" config on new account #1862
 - Restore of backup did not rebuild the "Forced SSL" and "HSTS" config on new account #1862
+- Keep changes made by /install/upgrade/manual/install_awstats_geopip.sh on update HestiaCP (via Discord)
 
 
 ## [1.4.2] - Service release
 ## [1.4.2] - Service release
 
 

+ 8 - 0
bin/v-update-web-templates

@@ -26,6 +26,9 @@ source $HESTIA/conf/hestia.conf
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+# Check if /install/upgrade/manual/install_awstats_geoip.sh has been applied 
+awstats_patch=$(cat  $HESTIA/data/templates/web/awstats/awstats.tpl | grep "LoadPlugin=\"geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat\"");
+
 # Update templates
 # Update templates
 if [ -d "${WEBTPL}" ]; then
 if [ -d "${WEBTPL}" ]; then
     rm -rf "${WEBTPL}/skel" 2>/dev/null
     rm -rf "${WEBTPL}/skel" 2>/dev/null
@@ -48,6 +51,11 @@ for php_ver in $(ls /etc/php/); do
     cp -f "$HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl"  ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl
     cp -f "$HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl"  ${WEBTPL}/php-fpm/PHP-${php_ver/\./_}.tpl
 done
 done
 
 
+if [ ! -z "$awstats_patch" ]; then 
+    # restore LoadPlugin variable
+    echo "LoadPlugin=\"geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat\"" >> $HESTIA/data/templates/web/awstats/awstats.tpl
+fi
+
 # Rebuilding web domains
 # Rebuilding web domains
 if [  -z "$skip" ]; then
 if [  -z "$skip" ]; then
     for user in $($BIN/v-list-sys-users plain); do
     for user in $($BIN/v-list-sys-users plain); do