#!/bin/bash
set -e
num=${1:-4}
pool="${2:-/var/lib/openqa/pool}"
if [ ! -w "$pool" ]; then
	echo "can't write $pool! (got root?)\n"
	exit 1
fi
uid=`stat -c %u "$pool"`
for ((i=1;i<=$num;++i)); do
	install -d -o "$uid"  "$pool/$i"
done
echo "created $num instances in $pool"
