view scripts/test_accounts/create_accounts.sh @ 153:df75b62e653e

flatpak (build_manifest): some fixes needed after runtime update: - removed `--optimize=1` for lxml, as it is making the build fail - added build flag on x86_64 for Pillow (will need to be adapted if we build on other architectures) - added a module for Python 2.7.16, Python 2 not being included anymore in the runtime - DEFAULT_MANIFEST modules are put at the beginning of modules
author Goffi <goffi@goffi.org>
date Fri, 28 Jun 2019 15:19:47 +0200
parents 4cd5475623eb
children
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
        jp profile create $USER -j $JID -p $PASSWD
        echo OK
    done
done
cp -r data/* ~/workspace/prosody-hg/data/