break-in
author Paul Crowley <paul@lshift.net>
Wed, 28 May 2008 18:14:15 +0100
changeset 31 d54720d47ca2
child 32 4059dbe9f26a
permissions -rwxr-xr-x
start to move towards things living where they should and new break-in system. Big change.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     1
#!/bin/sh
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     2
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     3
set -e
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     4
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     5
REPO=~hg/repos/hgadmin
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     6
sudo -u hg -H hg -q -R "$REPO" update null
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     7
sudo -u hg mkdir $REPO/keys
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     8
cp $1 $REPO/keys/root
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     9
cd $REPO
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    10
echo "init user=root" > hg-ssh-access.conf
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    11
sudo -u hg -H /usr/local/lib/hg-admin-tools/refresh-auth ~/.ssh/authorized_keys /etc/hg-admin-tools/hg-ssh-wrapper
d54720d47ca2 start to move towards things living where they should and new
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    12