mirror of
https://github.com/myvesta/vesta.git
synced 2024-12-21 11:31:21 -08:00
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: update user package
|
|
# options: PACKAGE
|
|
#
|
|
# The function propagates package to connected users.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
package=$1
|
|
|
|
# Includes
|
|
source $VESTA/func/main.sh
|
|
source $VESTA/conf/vesta.conf
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
check_args '1' "$#" 'PACKAGE'
|
|
is_format_valid 'package'
|
|
is_package_valid
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
for user in $(ls $VESTA/data/users); do
|
|
check_package=$(grep "PACKAGE='$package'" $USER_DATA/$user/user.conf)
|
|
if [ ! -z "$check_package" ]; then
|
|
$BIN/v-change-user-package $user $package 'yes'
|
|
fi
|
|
done
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event "$OK" "$ARGUMENTS"
|
|
|
|
exit
|