#!/usr/bin/env sh
set -ex

echo "mount loop device"
mkdir /data
tcplay --map=data2 --device=`losetup -f --show /test.tc`
# losetup /dev/loop0 foo.tc
#tcplay -m test.tc -d /dev/loop0
mount -o nodev,nosuid,uid=1000,gid=100 /dev/mapper/data2 /data

echo "Starting stash app!"

exec /usr/bin/stash

echo "Goodbye!"
