mirror of
https://github.com/YunoHost-Apps/aeneria_ynh.git
synced 2024-09-03 18:06:15 +02:00
26 lines
652 B
Text
26 lines
652 B
Text
|
#!/bin/bash
|
||
|
app=APPNAMETOCHANGE
|
||
|
|
||
|
# Source YunoHost helpers
|
||
|
source /usr/share/yunohost/helpers
|
||
|
source /etc/yunohost/apps/$app/scripts/ynh_exec_as
|
||
|
|
||
|
# Retrieve arguments
|
||
|
username=$1
|
||
|
mail=$2
|
||
|
password=$3 # Clear password
|
||
|
firstname=$4
|
||
|
lastname=$5
|
||
|
final_path=$(ynh_app_setting_get "$app" final_path)
|
||
|
|
||
|
pushd $final_path
|
||
|
user_exists=$(ynh_exec_as $app php7.3 bin/console aeneria:user:exist "$mail")
|
||
|
if [ $user_exists -eq 0 ]
|
||
|
then
|
||
|
user_pass=$(ynh_string_random)
|
||
|
ynh_exec_as $app php7.3 bin/console aeneria:user:add "$mail" "$user_pass" -n
|
||
|
else
|
||
|
ynh_exec_as $app php7.3 bin/console aeneria:user:activate "$mail"
|
||
|
fi
|
||
|
popd
|