install
author Paul Crowley <paul@ciphergoth.org>
Wed, 23 Apr 2008 09:23:32 +0100
changeset 27 ec31ba248edd
child 31 d54720d47ca2
permissions -rwxr-xr-x
Installer to set things up 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