|
|
@@ -5,8 +5,10 @@
|
|
|
#
|
|
|
# example: v-delete-user-package admin palegreen
|
|
|
#
|
|
|
-# The function for deleting user package. It does not allow to delete package
|
|
|
-# if it is in use.
|
|
|
+# The function for deleting user package.
|
|
|
+#
|
|
|
+# If the package is in use, users will be updated to
|
|
|
+# use the default package.
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
@@ -22,11 +24,11 @@ source $HESTIA/conf/hestia.conf
|
|
|
|
|
|
# Functions
|
|
|
is_package_in_use() {
|
|
|
- check_package=$(grep "PACKAGE='$package'" $USER_DATA/*/user.conf)
|
|
|
+ check_package=$(grep "PACKAGE='default" $HESTIA/data/users/*/user.conf | cut -d'/' -f7)
|
|
|
if [ ! -z "$check_package" ]; then
|
|
|
- echo "Error: package $package is in use"
|
|
|
- log_event "$E_INUSE" "$ARGUMENTS"
|
|
|
- exit $E_INUSE
|
|
|
+ for user in $check_package; do
|
|
|
+ $BIN/v-change-user-package "$user" 'default'
|
|
|
+ done
|
|
|
fi
|
|
|
}
|
|
|
|