Browse Source

Ver 1.1

pull/1/head
Sébastien Faton 3 years ago
parent
commit
0e2fbbfe1c
  1. 11
      Nextcloud/imports-account-csv.sh

11
Nextcloud/imports-account-csv.sh

@ -1,10 +1,9 @@
#!/bin/bash
#!/bin/bash
input="accountsn.csv"
OLDIFS=$IFS
IFS=','
var_apache_user=www-data
var_path_nextcloud=/usr/share/nginx/nextcloud/
var_result_file="${var_datum}_user_create.txt"
while read -r display_name username group password email
do
@ -13,10 +12,10 @@ do
var_group=$(echo $group )
var_password=$(echo $password )
var_email=$(echo $email )
echo "resultat :"
echo ${var_username}
export OC_PASS={$var_password}
su -s /bin/sh ${var_apache_user} -c " php ${var_path_nextcloud}occ user:add --display-name='${var_display_name}' --password-from-env --group='${var_group}' '${var_username}' "
echo "account : ${email}"
export OC_PASS={$var_password}
su -s /bin/sh ${var_apache_user} -c " php ${var_path_nextcloud}occ user:add --display-name='${var_display_name}' --password-from-env --group='${var_group}' '${var_username}' "
done < $input
IFS=$OLDIFS
Loading…
Cancel
Save