From e1151297761107cbdb26ee53e51124cd8146de89 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sun, 25 Jul 2010 09:01:04 +0530 Subject: [PATCH] (minor) gl-setup fixes - stop erroring out if run from elsewhere than $HOME (by localising the "cd" we need somewhere in between) - catch the admin@home.pub usage early - minor fix to the backticked commands - gl-setup now does 'chmod go-rwx .ssh' --- src/gl-setup | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/gl-setup b/src/gl-setup index b12d9fd..d19b6b2 100755 --- a/src/gl-setup +++ b/src/gl-setup @@ -28,6 +28,7 @@ then echo $pubkey_file | grep '.pub$' >/dev/null || die "$pubkey_file must end in .pub" [ -f $pubkey_file ] || die "cant find $pubkey_file" admin_name=` basename $pubkey_file .pub` + echo $admin_name | grep '@' >/dev/null && die "please don't use '@' in the initial admin name" fi if [ -f $HOME/.gitolite.rc ] @@ -54,17 +55,20 @@ fi # setup ssh stuff. We break our normal rule that we will not fiddle with # authkeys etc., because in this case it seems appropriate -cd -mkdir -p .ssh -touch .ssh/authorized_keys -chmod go-w . .ssh .ssh/authorized_keys +( + cd $HOME + mkdir -p .ssh + chmod go-rwx .ssh + touch .ssh/authorized_keys + chmod go-w . .ssh .ssh/authorized_keys +) # now we get to gitolite itself gl-install -q -GL_ADMINDIR=` cd;perl -e 'do ".gitolite.rc"; print $GL_ADMINDIR'` -REPO_BASE=` cd;perl -e 'do ".gitolite.rc"; print $REPO_BASE' ` +GL_ADMINDIR=` cd $HOME;perl -e 'do ".gitolite.rc"; print $GL_ADMINDIR'` +REPO_BASE=` cd $HOME;perl -e 'do ".gitolite.rc"; print $REPO_BASE' ` [ -f $GL_ADMINDIR/conf/gitolite.conf ] || { cat < $GL_ADMINDIR/conf/gitolite.conf