#!/bin/sh

IMPORT_DIR=$1

IMPORTED=$IMPORT_DIR/imported

mkdir $IMPORTED

cd /opt/Xemelios/root

for f in `ls -1 $IMPORT_DIR | grep 'xar' | sort` ; do
	java -Xms312M -Xmx1024M -jar import-batch.jar -u admin -i no -d xemelios.archive -f $IMPORT_DIR/$f 
	mv $IMPORT_DIR/$f $IMPORTED
	rm -rf /tmp/XEMELIOS
done

