install
author Paul Crowley <paul@lshift.net>
Fri, 02 May 2008 17:33:39 +0100
changeset 29 87279134a212
parent 27 ec31ba248edd
child 31 d54720d47ca2
permissions -rwxr-xr-x
Convert PuTTY-style public keys automatically
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
ssh-add -L > first-adminkey
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
if [ \! -s first-adminkey ] ; then
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     8
    echo "No key defined in ssh agent; exiting"
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
     9
    exit -1
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    10
fi
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    11
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    12
sudo adduser --system --shell /bin/sh --group --disabled-password \
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    13
   --gecos "Mercurial repositories" hg
ec31ba248edd Installer to set things up automatically
Paul Crowley <paul@ciphergoth.org>
parents:
diff changeset
    14
sudo -u hg -H ./hginit