Просмотр исходного кода

Fix issues with manual upgrade script resetting.. (#4105)

* Fix Nginx + Apache2 to Nginx Only setup script

* Other scripts with the same issue
Jaap Marcus 2 лет назад
Родитель
Сommit
7af9fa5e64

+ 2 - 1
install/upgrade/manual/migrate_apache.sh

@@ -42,8 +42,9 @@ if [ ! -z "$WEB_SYSTEM" ]; then
 	cp -rf "${HESTIA_INSTALL_DIR}/templates/web/$WEB_SYSTEM" "${WEBTPL}/"
 fi
 
-sed -i "/^WEB_BACKEND=/d" $HESTIA/conf/hestia.conf
+sed -i "/^WEB_BACKEND=/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 echo "WEB_BACKEND='php-fpm'" >> $HESTIA/conf/hestia.conf
+echo "WEB_BACKEND='php-fpm'" >> $HESTIA/conf/defaults/hestia.conf
 
 for user in $($BIN/v-list-sys-users plain); do
 	# Define user data and get suspended status

+ 14 - 8
install/upgrade/manual/migrate_ngnix_apache_nginx-php-fpm.sh

@@ -34,16 +34,16 @@ fi
 #----------------------------------------------------------#
 
 # Remove apache2 from config
-sed -i "/^WEB_PORT/d" $HESTIA/conf/hestia.conf
-sed -i "/^WEB_SSL/d" $HESTIA/conf/hestia.conf
-sed -i "/^WEB_SSL_PORT/d" $HESTIA/conf/hestia.conf
-sed -i "/^WEB_RGROUPS/d" $HESTIA/conf/hestia.conf
-sed -i "/^WEB_SYSTEM/d" $HESTIA/conf/hestia.conf
+sed -i "/^WEB_PORT/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
+sed -i "/^WEB_SSL/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
+sed -i "/^WEB_SSL_PORT/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
+sed -i "/^WEB_RGROUPS/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
+sed -i "/^WEB_SYSTEM/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 
 # Remove nginx (proxy) from config
-sed -i "/^PROXY_PORT/d" $HESTIA/conf/hestia.conf
-sed -i "/^PROXY_SSL_PORT/d" $HESTIA/conf/hestia.conf
-sed -i "/^PROXY_SYSTEM/d" $HESTIA/conf/hestia.conf
+sed -i "/^PROXY_PORT/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
+sed -i "/^PROXY_SSL_PORT/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
+sed -i "/^PROXY_SYSTEM/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 
 # Add Nginx settings to config
 echo "WEB_PORT='80'" >> $HESTIA/conf/hestia.conf
@@ -51,6 +51,12 @@ echo "WEB_SSL='openssl'" >> $HESTIA/conf/hestia.conf
 echo "WEB_SSL_PORT='443'" >> $HESTIA/conf/hestia.conf
 echo "WEB_SYSTEM='nginx'" >> $HESTIA/conf/hestia.conf
 
+# Add Nginx settings to config
+echo "WEB_PORT='80'" >> $HESTIA/conf/defaults/hestia.conf
+echo "WEB_SSL='openssl'" >> $HESTIA/conf/defaults/hestia.conf
+echo "WEB_SSL_PORT='443'" >> $HESTIA/conf/defaults/hestia.conf
+echo "WEB_SYSTEM='nginx'" >> $HESTIA/conf/defaults/hestia.conf
+
 rm $HESTIA/conf/defaults/hestia.conf
 cp $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 

+ 4 - 4
install/upgrade/manual/remove-mail-stack.sh

@@ -30,24 +30,24 @@ read -p 'Would you like to continue? [y/n]'
 
 if [ "$ANTISPAM_SYSTEM" == "spamassassin" ]; then
 	echo Removing Spamassassin
-	sed -i "/^ANTISPAM_SYSTEM/d" $HESTIA/conf/hestia.conf
+	sed -i "/^ANTISPAM_SYSTEM/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 	systemctl disable --now spamassassin
 fi
 
 if [ "$ANTIVIRUS_SYSTEM" == "clamav-daemon" ]; then
 	echo Removing ClamAV
-	sed -i "/^ANTIVIRUS_SYSTEM/d" $HESTIA/conf/hestia.conf
+	sed -i "/^ANTIVIRUS_SYSTEM/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 	systemctl disable --now clamav-daemon clamav-freshclam
 fi
 
 if [ "$IMAP_SYSTEM" == "dovecot" ]; then
 	echo Removing Dovecot
-	sed -i "/^IMAP_SYSTEM/d" $HESTIA/conf/hestia.conf
+	sed -i "/^IMAP_SYSTEM/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 	systemctl disable --now dovecot
 fi
 
 if [ "$MAIL_SYSTEM" == "exim4" ]; then
 	echo Removing Exim4
-	sed -i "/^MAIL_SYSTEM/d" $HESTIA/conf/hestia.conf
+	sed -i "/^MAIL_SYSTEM/d" $HESTIA/conf/hestia.conf $HESTIA/conf/defaults/hestia.conf
 	systemctl disable --now exim4
 fi