Przeglądaj źródła

Merge branch 'main' into feature/user-roles

Kristan Kenney 5 lat temu
rodzic
commit
3292a6b3cf
2 zmienionych plików z 7 dodań i 4 usunięć
  1. 5 2
      bin/v-rename-user-package
  2. 2 2
      install/upgrade/versions/1.4.0.sh

+ 5 - 2
bin/v-rename-package → bin/v-rename-user-package

@@ -29,9 +29,11 @@ source $HESTIA/conf/hestia.conf
 # Ensure that package names have been passed to the script.
 if [ -z "$old_name" ]; then
     echo "ERROR: Current package name not specified."
+    exit 1
 fi
 if [ -z "$new_name" ]; then
     echo "ERROR: New package name not specified."
+    exit 1
 fi
 
 # Perform verification if read-only mode is enabled
@@ -44,7 +46,7 @@ check_hestia_demo_mode
 
 if [ -e $HESTIA/data/packages/$old_name.pkg ]; then
     mv $HESTIA/data/packages/$old_name.pkg $HESTIA/data/packages/$new_name.pkg
-    echo "Successfully renamed $old_name to $new_name."
+    
 
     # Update package for existing users
     for user in `ls $HESTIA/data/users/`; do
@@ -54,6 +56,7 @@ if [ -e $HESTIA/data/packages/$old_name.pkg ]; then
             v-change-user-package $user $new_name
         fi
     done
+    echo "Successfully renamed package $old_name to $new_name."
 else
     echo "ERROR: Specified package not found."
 fi
@@ -64,7 +67,7 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-log_history "renamed package $old_name to $new_name"
+log_history "renamed package $old_name to $new_name" '' 'admin'
 log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 2
install/upgrade/versions/1.4.0.sh

@@ -25,11 +25,11 @@ if [ "$MAIL_SYSTEM" == "exim4" ]; then
     echo "[ * ] Populating HELO/SMTP Banner param for existing IP's..."
     > /etc/exim4/mailhelo.conf
 
-    for ip in $(v-list-sys-ips plain | cut -f1); do
+    for ip in $($BIN/v-list-sys-ips plain | cut -f1); do
         helo=$(is_ip_rdns_valid $ip)
 
         if [ ! -z "$helo" ]; then
-            v-change-sys-ip-helo $ip $helo
+            $BIN/v-change-sys-ip-helo $ip $helo
         fi
     done