소스 검색

Keep changes made to awstats.tpl on upgrade

Users are required to apply a patch to update awstats.tpl on upgrade Hestia.
Jaap Marcus 4 년 전
부모
커밋
6036812b42
2개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  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
 - Increased minimal memory requirements for ClamD / ClamAV.  #1840
 - 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
 

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

@@ -26,6 +26,9 @@ source $HESTIA/conf/hestia.conf
 #                       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
 if [ -d "${WEBTPL}" ]; then
     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
 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
 if [  -z "$skip" ]; then
     for user in $($BIN/v-list-sys-users plain); do