#!/bin/sh -e

CONFIG_FILE=/etc/pyirct.xml
XMLROOT=pyirct
XMLNODE=

case "$1" in
    --ip) XMLNODE=mainServer
    ;;
    --port) XMLNODE=port
    ;;
    --host) XMLNODE=jid
    ;;
    --password) XMLNODE=secret
    ;;
    default)
    exit 1
esac

echo "cat $XMLROOT/$XMLNODE" | xmllint --shell $CONFIG_FILE |\
    sed -e '/^\/ >/d' -e 's/\(<[^>]*>\)\|\(<\/[^>]*>\)//g'
