-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathstart.sh
29 lines (25 loc) · 815 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/sh -
# handle the gitolite.rc
if [ -f "/home/git/repositories/gitolite.rc" ]; then
echo 'import rc file'
su git -c "cp /home/git/repositories/gitolite.rc /home/git/.gitolite.rc"
else
echo 'export rc file'
su git -c "cp /home/git/.gitolite.rc /home/git/repositories/gitolite.rc"
fi
if [ -f /home/git/repositories/gitolite-configured ]; then
su git -c "/home/git/bin/gitolite setup"
else
# handle the ssh key
if [ -n "$SSH_KEY" ]; then
echo "Replace the admin ssh key.\n"
echo $SSH_KEY > /home/git/admin.pub
su git -c "/home/git/bin/gitolite setup -pk=/home/git/admin.pub"
else
su git -c "/home/git/bin/gitolite setup"
echo "The built-in private key for admin:\n"
cat /admin
fi
su git -c "touch /home/git/repositories/gitolite-configured"
fi
/usr/sbin/sshd -D