Browse Source

Fix/2021 02 minor bug fixes (#1641)

* #1633  Changed Web domain $1 exist to Web domain $1 exists

* #1623 Update v-change-user-cli when no input is given

* #1623 “Supress” error message

* Improve error messaegs
Jaap Marcus 5 years ago
parent
commit
342eb2e541
3 changed files with 8 additions and 7 deletions
  1. 4 3
      bin/v-change-user-php-cli
  2. 2 2
      func/domain.sh
  3. 2 2
      func/main.sh

+ 4 - 3
bin/v-change-user-php-cli

@@ -27,15 +27,16 @@ source $HESTIA/conf/hestia.conf
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-# Reading user values
-source $USER_DATA/user.conf
-
 FILE=$HOMEDIR/$user/.bash_aliases
 
+check_args '2' "$#" 'USER PHPVERSION'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
+# Reading user values
+source $USER_DATA/user.conf
+
 # 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]..."

+ 2 - 2
func/domain.sh

@@ -38,11 +38,11 @@ is_web_domain_new() {
     web=$(grep -F -H "DOMAIN='$1'" $HESTIA/data/users/*/web.conf)
     if [ ! -z "$web" ]; then
         if [ "$type" == 'web' ]; then
-            check_result $E_EXISTS "Web domain $1 exist"
+            check_result $E_EXISTS "Web domain $1 exists"
         fi
         web_user=$(echo "$web" |cut -f 7 -d /)
         if [ "$web_user" != "$user" ]; then
-            check_result $E_EXISTS "Web domain $1 exist"
+            check_result $E_EXISTS "Web domain $1 exists"
         fi
     fi
 }

+ 2 - 2
func/main.sh

@@ -239,7 +239,7 @@ is_object_new() {
         object=$(grep "$2='$3'" $USER_DATA/$1.conf)
     fi
     if [ ! -z "$object" ]; then
-        check_result $E_EXISTS "$2=$3 is already exists"
+        check_result $E_EXISTS "$2=$3 already exists"
     fi
 }
 
@@ -346,7 +346,7 @@ is_object_value_empty() {
     parse_object_kv_list "$str"
     eval value=$4
     if [ ! -z "$value" ] && [ "$value" != 'no' ]; then
-        check_result $E_EXISTS "${4//$}=$value is already exists"
+        check_result $E_EXISTS "${4//$}=$value already exists"
     fi
 }