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

Chore/various improvements (#4473)

* Bugfix: Node.js installation overwriting log

* Sync PHP packages for MultiPHP with default

* Use version variable for Node.js

* Remove quota package when service removed

* Remove quota package when service removed

* Improve checking whether Apache config exists

* Fix typos
Alexandros Ioannides 1 год назад
Родитель
Сommit
230f02c168

+ 1 - 1
bin/v-add-sys-web-terminal

@@ -54,7 +54,7 @@ if [ -z $(which "node") ]; then
 else
 	node_v_installed=$(/usr/bin/node -v | cut -f1 -d'.' | sed 's/v//g')
 	if [ "$node_v_installed" -lt "$node_v" ]; then
-		echo "Web Terminal requires Node.js 20.x or higher"
+		echo "Web Terminal requires Node.js $node_v or latest"
 		exit 1
 	fi
 fi

+ 3 - 3
bin/v-add-web-php

@@ -63,14 +63,14 @@ check_hestia_demo_mode
 mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli php$version-curl
      php$version-fpm php$version-gd php$version-intl php$version-mysql
      php$version-soap php$version-xml php$version-zip php$version-json php$version-bz2
-     php$version-pspell php$version-imagick php$version-pgsql php$version-imap php$version-ldap"
+     php$version-pspell php$version-imagick php$version-pgsql php$version-imap php$version-ldap php$version-apcu"
 
-# Check is version is 7.1 or below to add mcrypt
+# Check if version is 7.1 or below to add mcrypt
 if [[ $(echo "$version 7.2" | awk '{print ($1 < $2)}') == 1 ]]; then
 	mph="$mph php$version-mcrypt"
 fi
 
-# Check if version is 8.0 or higher and drop php json.
+# Check if version is 8.0 or higher and drop json
 if [[ ${version:0:1} == "8" ]]; then
 	mph=$(echo "$mph" | sed -e "s/php$version-json//")
 fi

+ 1 - 1
bin/v-change-sys-webmail

@@ -51,7 +51,7 @@ for user in $("$BIN/v-list-users" list); do
 	done
 done
 
-if [ -d /etc/apache2/ ]; then
+if [ -s /etc/apache2/apache2.conf ]; then
 	sed -i "s/IncludeOptional conf.d\/domains\/$WEBMAIL_ALIAS.*.conf/IncludeOptional conf.d\/domains\/$NEW_ALIAS.*.conf/g" /etc/apache2/apache2.conf
 fi
 

+ 3 - 0
bin/v-delete-sys-quota

@@ -64,6 +64,9 @@ fi
 # Updating hestia.conf value
 $BIN/v-change-sys-config-value "DISK_QUOTA" "no"
 
+# Remove quota package
+apt-get -y purge quota > /dev/null 2>&1
+
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 3 - 3
bin/v-delete-web-php

@@ -62,9 +62,9 @@ mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli
  php$version-fpm php$version-gd php$version-intl php$version-mysql
  php$version-soap php$version-xml php$version-zip php$version-mbstring
  php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql
- php$version-imap php$version-ldap"
+ php$version-imap php$version-ldap php$version-apcu"
 
-# Check is version is 7.1 or below to add mcrypt
+# Check if version is 7.1 or below to remove mcrypt
 if [[ $(echo "$version 7.2" | awk '{print ($1 < $2)}') == 1 ]]; then
 	mph="$mph php$version-mcrypt"
 fi
@@ -89,7 +89,7 @@ done
 # Do a blank echo to get the \n back
 echo
 
-# Check if installation was successfully
+# Check if removal was successful
 if [ -f "$php_fpm" ]; then
 	echo "ERROR: Uninstallation failed, please run the following command manually for debugging:"
 	if [ -f '/etc/redhat-release' ]; then

+ 2 - 2
install/hst-install-debian.sh

@@ -871,7 +871,7 @@ if [ "$webterminal" = 'yes' ]; then
 	echo "[ * ] Node.js $node_v"
 	echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/nodejs.gpg] https://deb.nodesource.com/node_$node_v.x nodistro main" > $apt/nodejs.list
 	curl -s https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodejs.gpg > /dev/null 2>&1
-	apt-get -y install nodejs > $LOG
+	apt-get -y install nodejs >> $LOG
 fi
 
 # Installing PostgreSQL repo
@@ -1196,7 +1196,7 @@ systemctl restart ssh
 
 # Disable AWStats cron
 rm -f /etc/cron.d/awstats
-# Replace awstatst function
+# Replace AWStats function
 cp -f $HESTIA_INSTALL_DIR/logrotate/httpd-prerotate/* /etc/logrotate.d/httpd-prerotate/
 
 # Set directory color

+ 2 - 2
install/hst-install-ubuntu.sh

@@ -841,7 +841,7 @@ if [ "$webterminal" = 'yes' ]; then
 	echo "[ * ] Node.js $node_v"
 	echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/nodejs.gpg] https://deb.nodesource.com/node_$node_v.x nodistro main" > $apt/nodejs.list
 	curl -s https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodejs.gpg > /dev/null 2>&1
-	apt-get -y install nodejs > $LOG
+	apt-get -y install nodejs >> $LOG
 fi
 
 # Installing PostgreSQL repo
@@ -1183,7 +1183,7 @@ systemctl restart ssh
 
 # Disable AWStats cron
 rm -f /etc/cron.d/awstats
-# Replace awstatst function
+# Replace AWStats function
 cp -f $HESTIA_INSTALL_DIR/logrotate/httpd-prerotate/* /etc/logrotate.d/httpd-prerotate/
 
 # Set directory color