refresh-auth now takes ~/.ssh/authorized_keys as an argument, and
it checks that it wrote it last time before rewriting it.
#!/bin/sh
set -e
ssh-add -L > first-adminkey
if [ \! -s first-adminkey ] ; then
echo "No key defined in ssh agent; exiting"
exit -1
fi
sudo adduser --system --shell /bin/sh --group --disabled-password \
--gecos "Mercurial repositories" hg
sudo -u hg -H ./hginit