break-in
changeset 32 4059dbe9f26a
parent 31 d54720d47ca2
--- a/break-in	Wed May 28 18:14:15 2008 +0100
+++ b/break-in	Thu Jun 05 16:53:57 2008 +0100
@@ -2,11 +2,13 @@
 
 set -e
 
-REPO=~hg/repos/hgadmin
-sudo -u hg -H hg -q -R "$REPO" update null
-sudo -u hg mkdir $REPO/keys
-cp $1 $REPO/keys/root
-cd $REPO
-echo "init user=root" > hg-ssh-access.conf
-sudo -u hg -H /usr/local/lib/hg-admin-tools/refresh-auth ~/.ssh/authorized_keys /etc/hg-admin-tools/hg-ssh-wrapper
+user=$(whoami)
 
+/usr/local/lib/hg-admin-tools/create-breakin-repository
+cd hgadmin
+mkdir -p keys
+ssh-add -L > keys/$user
+echo "init user=$user" > hg-ssh-access.conf
+hg add keys/$user hg-ssh-access.conf
+hg commit -m "Give all access only to user $user"
+hg push