src/init/break-in/do-breakin
author Paul Crowley <paul@lshift.net>
Thu, 19 Feb 2009 16:36:41 +0000
changeset 38 f1ee930c4ba8
permissions -rw-r--r--
Add start of script for breaking in

#!/bin/sh

set -e

HOME=~hg
export HOME
cd

rm -rf temporary-breakin-repo
mkdir temporary-breakin-repo
cd temporary-breakin-repo
hg clone ~/repos/hgadmin .
if [ $(echo *) != "" ] ; then
 DIRNAME=retry
  while [ $DIRNAME = retry ] ; do
    DIRNAME=$(date -u +"%F_%T.%N")
    mkdir $DIRNAME || DIRNAME=retry
  done
  hg mv * $DIRNAME
  hg mv -f $DIRNAME old
fi
hg echo "init user=initkey" > hg-ssh-access.conf
mkdir keys
cat > keys/initkey
hg add hg-ssh-access.conf keys/initkey
hg commit -m "Reset access to a single key via break-in script"
SSH_ORIGINAL_COMMAND= /etc/mercurial-server/hg-ssh-wrapper root