Mercurial > sat_docs
comparison scripts/test_accounts/create_accounts.sh @ 40:1eb3ec190ea1
add test_accounts to create a batch of testing profiles
author | souliane <souliane@mailoo.org> |
---|---|
date | Sun, 08 Mar 2015 14:33:03 +0100 |
parents | |
children | 36d158a50c8a |
comparison
equal
deleted
inserted
replaced
39:58d99be2306e | 40:1eb3ec190ea1 |
---|---|
1 #!/bin/bash | |
2 | |
3 # This is a helping script to create some test accounts. XMPP passwords are | |
4 # retrieved from the DAT files in the data/<domain> directories, but you still | |
5 # need to copy these files to your prosody installation directory. | |
6 | |
7 # The provided data directory contains some test accounts for two differents | |
8 # domains (souliane.org and tazar.int), roster subscriptions and avatars. | |
9 | |
10 LIST=`jp profile list` | |
11 | |
12 for DIR in `ls data`; do | |
13 DOMAIN=`echo $DIR | sed s/%2e/./` | |
14 for FILE in `ls data/$DIR/accounts`; do | |
15 USER=`echo $FILE | sed s/.dat//` | |
16 JID=$USER@$DOMAIN | |
17 PASSWD=`cat data/$DIR/accounts/$FILE | grep "\"password\"" | cut -d "\"" -f 4` | |
18 echo -n Creating account for $JID... | |
19 if [[ $LIST =~ $USER ]]; then | |
20 echo -n removing existing account first... | |
21 #jp profile delete $USER | |
22 fi | |
23 echo jp profile create $USER $JID $PASSWD | |
24 echo OK | |
25 done | |
26 done |