Browse Source

Merge branch 'refactor/scripts' into staging/fixes

Kristan Kenney 5 years ago
parent
commit
dc2e1ff654
3 changed files with 11 additions and 9 deletions
  1. 6 5
      bin/v-add-web-php
  2. 4 3
      bin/v-delete-web-php
  3. 1 1
      bin/v-list-sys-php

+ 6 - 5
bin/v-add-web-php

@@ -28,19 +28,20 @@ php_fpm="/etc/init.d/php$version-fpm"
 
 # Verify php version format
 if [[ ! $version =~ ^[0-9]\.[0-9]+ ]]; then
-    echo "The php version format is invalid, it should look like [0-9].[0-9]..."
+    echo "The specified PHP version format is invalid, it should look like [0-9].[0-9]."
+    echo "Example:  7.0, 7.4"
     exit
 fi
 
 # Check if php version already exists
 if [ -f "$php_fpm" ] && [ -f "$HESTIA/data/templates/web/php-fpm/PHP-${version/\./_}.tpl" ]; then
-    echo "Version already installed..."
+    echo "ERROR: Specified PHP version is already installed."
     exit
 fi
 
 # Check if php version is supported
 if [ ! -f "$HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.sh" ]; then
-    echo "Version is currently not supported or does not exist..."
+    echo "ERROR: Specified PHP version is not supported or does not exist."
     exit
 fi
 
@@ -77,7 +78,7 @@ apt-get -y -qq -o Dpkg::Options::="--force-confold" install $mph > /dev/null 2>&
 BACK_PID=$!
 
 # Check if package installation is done, print a spinner
-echo "Install PHP-$version, please wait..."
+echo "Installing PHP-$version, please wait..."
 spinner="/-\|"
 spin_i=1
 while kill -0 $BACK_PID > /dev/null 2>&1 ; do
@@ -90,7 +91,7 @@ echo
 
 # Check if installation was sucessfully
 if [ ! -f "$php_fpm" ]; then
-    echo "Installation failed, please run the following command manualy for debuging:"
+    echo "ERROR: Installation failed, please run the following command manually for debugging:"
     echo "apt-get install $mph"
 fi
 

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

@@ -28,7 +28,8 @@ php_fpm="/etc/init.d/php$version-fpm"
 
 # Verify php version format
 if [[ ! $version =~ ^[0-9]\.[0-9]+ ]]; then
-    echo "The php version format is invalid, it should look like [0-9].[0-9]..."
+    echo "The PHP version format is invalid, it should look like [0-9].[0-9]."
+    echo "Example:  7.0, 7.4"
     exit
 fi
 
@@ -37,7 +38,7 @@ fi
 
 # Check if php version exists
 if [ ! -f "$php_fpm" ] && [ ! -f "$HESTIA/data/templates/$WEB_SYSTEM/PHP-$version.sh" ]; then
-    echo "Version is not installed..."
+    echo "ERROR: Specified PHP version is not installed."
     exit
 fi
 
@@ -77,7 +78,7 @@ echo
 
 # Check if installation was sucessfully
 if [ -f "$php_fpm" ]; then
-    echo "Uninstallation failed, please run the following command manualy for debuging:"
+    echo "ERROR: Uninstallation failed, please run the following command manually for debugging:"
     echo "apt-get purge $mph"
 fi
 

+ 1 - 1
bin/v-list-sys-php

@@ -61,7 +61,7 @@ csv_list() {
 #                       Action                             #
 #----------------------------------------------------------#
 
-# List trough /etc/php
+# List through /etc/php
 versions_list=$(ls -d /etc/php/*)
 versions=()
 for version in $versions_list; do