#!/bin/sh

if [ "$#" != 1 ]; then
	echo 'Usage: check-progress schroot-id' 1>&2
	exit 1
fi
schroot_id="$1"

schroot_base='/var/lib/schroot'
schroot_mount="$schroot_base/mount/$schroot_id"

bootlog="$schroot_mount/tmp/bootstrap.log"

echo '=== Done:'
egrep -A2 -e '^progress-mark:' "$bootlog" | tail -n3

echo
echo '=== Now running:'
tail -n3 "$bootlog"
