Add start of script for breaking in
authorPaul Crowley <paul@lshift.net>
Thu, 19 Feb 2009 16:36:41 +0000
changeset 38 f1ee930c4ba8
parent 37 d35a30672369
child 39 f5055ce263c7
Add start of script for breaking in
src/init/break-in/do-breakin
--- /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
+