#!/bin/bash

if [ "$(id -u)" -ne 0 ]; then
	echo "switching from $(id -un) to root"
	exec sudo "$0" "$@"
fi
set -e
cd "$(dirname "$0")"
DIR="$(dirname "$0")"
cd ..
echo $PWD

rm -rf './outputs/root'
if [ ! -d ./outputs/root/bin ]; then
    rm -rf './outputs/root'
    mkdir -p ./outputs/root/
    debootstrap questing ./outputs/root https://us.archive.ubuntu.com/ubuntu
fi

