1
0
mirror of https://github.com/myvesta/vesta.git synced 2025-03-12 04:35:23 -07:00
myvesta/bin/v-update-user-package

48 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2013-01-19 23:07:26 +02:00
#!/bin/bash
# info: update user package
2015-11-06 17:38:58 +02:00
# options: PACKAGE
2013-01-19 23:07:26 +02:00
#
2015-11-06 17:38:58 +02:00
# The function propagates package to connected users.
2013-01-19 23:07:26 +02:00
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
2015-11-06 17:38:58 +02:00
# Argument definition
2013-01-19 23:07:26 +02:00
package=$1
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
2013-01-19 23:07:26 +02:00
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'PACKAGE'
is_format_valid 'package'
2013-01-19 23:07:26 +02:00
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"
2013-01-19 23:07:26 +02:00
exit