2021-04-17 18:39:02 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -a
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2019-01-04 17:50:59 +01:00
|
|
|
app=$1
|
2014-09-11 16:48:29 +02:00
|
|
|
new_users=$2
|
2017-02-13 23:06:33 +01:00
|
|
|
|
2021-04-17 18:39:02 +02:00
|
|
|
if [[ "${0//.\/50-}" = "$app" ]]; then
|
2023-06-29 19:08:38 +02:00
|
|
|
install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
2014-09-11 16:48:29 +02:00
|
|
|
|
2021-04-17 18:39:02 +02:00
|
|
|
for user in $(echo "$new_users" | sed "s/,/ /g")
|
2016-09-04 15:19:28 +02:00
|
|
|
do
|
2017-02-13 22:52:07 +01:00
|
|
|
user_token=$(ynh_string_random)
|
2023-06-29 19:08:38 +02:00
|
|
|
sudo -u $app $install_dir/cli/create-user.php --user $user --language en --token $user_token
|
2016-09-04 15:19:28 +02:00
|
|
|
done
|
|
|
|
fi
|