(http) gl-setup changes...
- only admin name needed, not pubkey file - setup HOME from GITOLITE_HTTP_HOME
This commit is contained in:
parent
f4e011226a
commit
ec329ca13f
11
src/gl-setup
11
src/gl-setup
|
@ -21,6 +21,12 @@ GL_PACKAGE_CONF=/tmp/share/gitolite/conf
|
||||||
|
|
||||||
die() { echo "$@"; exit 1; }
|
die() { echo "$@"; exit 1; }
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$GITOLITE_HTTP_HOME" ]
|
||||||
|
then
|
||||||
|
HOME=$GITOLITE_HTTP_HOME
|
||||||
|
admin_name=$1
|
||||||
|
else
|
||||||
pubkey_file=$1
|
pubkey_file=$1
|
||||||
admin_name=
|
admin_name=
|
||||||
if [ -n "$pubkey_file" ]
|
if [ -n "$pubkey_file" ]
|
||||||
|
@ -30,6 +36,7 @@ then
|
||||||
admin_name=` basename $pubkey_file .pub`
|
admin_name=` basename $pubkey_file .pub`
|
||||||
echo $admin_name | grep '@' >/dev/null && die "please don't use '@' in the initial admin name"
|
echo $admin_name | grep '@' >/dev/null && die "please don't use '@' in the initial admin name"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f $HOME/.gitolite.rc ]
|
if [ -f $HOME/.gitolite.rc ]
|
||||||
then
|
then
|
||||||
|
@ -49,7 +56,9 @@ then
|
||||||
fi
|
fi
|
||||||
rm -f .newvars .oldvars .diffvars
|
rm -f .newvars .oldvars .diffvars
|
||||||
else
|
else
|
||||||
[ -n "$pubkey_file" ] || die "looks like first run -- I need a pubkey file"
|
[ -n "$GITOLITE_HTTP_HOME" ] || [ -n "$pubkey_file" ] || die "looks like first run -- I need a pubkey file"
|
||||||
|
[ -z "$GITOLITE_HTTP_HOME" ] || [ -n "$admin_name" ] || die "looks like first run -- I need an admin name"
|
||||||
|
|
||||||
cp $GL_PACKAGE_CONF/example.gitolite.rc $HOME/.gitolite.rc
|
cp $GL_PACKAGE_CONF/example.gitolite.rc $HOME/.gitolite.rc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue