hginit
author Paul Crowley <paul@lshift.net>
Fri, 02 May 2008 18:03:42 +0100
changeset 30 98dbde5b13a1
parent 27 ec31ba248edd
child 31 d54720d47ca2
permissions -rwxr-xr-x
refresh-auth now takes ~/.ssh/authorized_keys as an argument, and it checks that it wrote it last time before rewriting it.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     1
#!/bin/sh
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     2
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     3
set -e
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     4
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     5
initdir=$(pwd)
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     6
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     7
cd
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     8
mkdir -p admin repos/hgadmin/keys/admin .ssh
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     9
cp -r "$initdir" admin/hg-admin-tools
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    10
cp admin/hg-admin-tools/hg-ssh-wrapper admin/hg-admin-tools/remote-hgrc ~
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    11
mv admin/hg-admin-tools/first-adminkey repos/hgadmin/keys/admin/first
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    12
cd repos/hgadmin
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    13
hg init .
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    14
echo "init user=admin/*" > hg-ssh-access.conf
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    15
hg add
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    16
hg commit -m "initial commit"
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    17
cp ../../admin/hg-admin-tools/hgadmin-hgrc .hg/hgrc
30
98dbde5b13a1 refresh-auth now takes ~/.ssh/authorized_keys as an argument, and
Paul Crowley <paul@lshift.net>
parents: 27
diff changeset
    18
../../admin/hg-admin-tools/refresh-auth ~/.ssh/authorized_keys ./hg-ssh-wrapper