src/init/hginit
changeset 168 f9bf8f84df7f
parent 165 3606d60b07e5
child 311 3cbde66305e4
--- a/src/init/hginit	Mon Nov 09 13:23:45 2009 +0000
+++ b/src/init/hginit	Mon Nov 09 15:46:05 2009 +0000
@@ -1,11 +1,17 @@
 #!/bin/sh
 
-# WARNING: this must be run from the hg user's home directory
+set -e
+
+cd
 
-set -e
+if [ -e .ssh/authorized_keys ] ; then
+    echo "This user already exists with authorized keys, aborting"
+    exit -1
+fi
 
 cp $1/init/dot-mercurial-server .mercurial-server
 mkdir -p repos/hgadmin .ssh
 cd repos/hgadmin
 hg init .
 cp $1/init/hgadmin-hgrc .hg/hgrc
+