src/init/break-in/do-breakin
changeset 38 f1ee930c4ba8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/init/break-in/do-breakin	Thu Feb 19 16:36:41 2009 +0000
@@ -0,0 +1,28 @@
+#!/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
+