diff --git a/scripts/install b/scripts/install index 47c8fcb..f9a07f8 100644 --- a/scripts/install +++ b/scripts/install @@ -185,15 +185,14 @@ ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_ ynh_script_progression --message="Create the first administrator and team..." --weight=1 team_name=$(echo "$team_display_name" | iconv -f utf8 -t ascii//TRANSLIT//IGNORE | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z) +bin_mmctl="$final_path/bin/mmctl" -pushd "$final_path" - export MMCTL_LOCAL=true - export MMCTL_LOCAL_SOCKET_PATH="$local_socket_path" +export MMCTL_LOCAL=true +export MMCTL_LOCAL_SOCKET_PATH="$local_socket_path" - ynh_exec_warn_less sudo --preserve-env -u $app bin/mmctl user create --username "$admin" --email "$email" --password "$password" --locale "$language" --email-verified --system-admin - ynh_exec_warn_less sudo --preserve-env -u $app bin/mmctl team create --name "$team_name" --display_name "$team_display_name" --email "$email" - ynh_exec_warn_less sudo --preserve-env -u $app bin/mmctl team users add "$team_name" "$admin" -popd +ynh_exec_warn_less sudo --preserve-env -u $app "$bin_mmctl" user create --username "$admin" --email "$email" --password "$password" --locale "$language" --email-verified --system-admin +ynh_exec_warn_less sudo --preserve-env -u $app "$bin_mmctl" team create --name "$team_name" --display_name "$team_display_name" --email "$email" +ynh_exec_warn_less sudo --preserve-env -u $app "$bin_mmctl" team users add "$team_name" "$admin" # Now that the first user is created, disable mmctl passwordless access ynh_replace_string '"EnableLocalMode": true' '"EnableLocalMode": false' "$final_path/config/config.json"