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

Change bin script name: v-rename-package > v-rename-user-package

Also fix bug in name detection routines
Kristan Kenney 5 лет назад
Родитель
Сommit
2f118a6bc0
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      bin/v-rename-user-package

+ 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