view scripts/test_accounts/create_accounts.sh @ 43:4c5bd7ddaaca

xep: updated XEP-0356 (privileged entity): Several updates according to feedbacks + review: - added links to PEP and namespace delegation XEPs - removed MUST for default values in configuration - <forwarded/> element is now a child of a <privilege/> element - <perm/> "namespace" attribute has been renamed to "access" - "headline" type restriction for "message" privilege has been removed - "message" permission violation now result in a "forbidden" message error - for "presence" permission, only <presence/> stanza with no type or with a "unavailable" type are sent to privileged entity - added specifitation for "presence" if a managed entity is unavailable and if a privileged entity is available after first <presence/> stanzas have been received - added Business Rules section - Updated namespace to reflect incompatible changes
author Goffi <goffi@goffi.org>
date Mon, 23 Mar 2015 18:41:01 +0100
parents 1eb3ec190ea1
children 36d158a50c8a
line wrap: on
line source

#!/bin/bash

# This is a helping script to create some test accounts. XMPP passwords are
# retrieved from the DAT files in the data/<domain> directories, but you still
# need to copy these files to your prosody installation directory.

# The provided data directory contains some test accounts for two differents
# domains (souliane.org and tazar.int), roster subscriptions and avatars.

LIST=`jp profile list`

for DIR in `ls data`; do
    DOMAIN=`echo $DIR | sed s/%2e/./`
    for FILE in `ls data/$DIR/accounts`; do
        USER=`echo $FILE | sed s/.dat//`
        JID=$USER@$DOMAIN
        PASSWD=`cat data/$DIR/accounts/$FILE | grep "\"password\"" | cut -d "\"" -f 4`
        echo -n Creating account for $JID...
        if [[ $LIST =~ $USER ]]; then
            echo -n removing existing account first...
            #jp profile delete $USER
        fi
        echo jp profile create $USER $JID $PASSWD
        echo OK
    done
done