Commit | Line | Data |
---|---|---|
4063cda3 IJ |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
9028e234 IJ |
4 | # Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk> |
5 | # Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk> | |
6 | # Copyright 1999,2003 | |
7 | # Chancellor Masters and Scholars of the University of Cambridge | |
8 | # Copyright 2010 Tony Finch <fanf@dotat.at> | |
4063cda3 IJ |
9 | # |
10 | # This file is part of userv-git-daemon, part of userv-utils | |
11 | # | |
12 | # This is free software; you can redistribute it and/or modify it | |
13 | # under the terms of the GNU General Public License as published by | |
9028e234 | 14 | # the Free Software Foundation; either version 3 of the License, or |
4063cda3 IJ |
15 | # (at your option) any later version. |
16 | # | |
17 | # This program is distributed in the hope that it will be useful, but | |
18 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 | # General Public License for more details. | |
21 | # | |
22 | # You should have received a copy of the GNU General Public License | |
9028e234 | 23 | # along with userv-utils; if not, see http://www.gnu.org/licenses/. |
4063cda3 IJ |
24 | |
25 | GITDUSER=git | |
26 | ||
27 | defaults=/etc/default/userv-git-daemon | |
28 | if test -f $defaults; then . $defaults; fi | |
29 | ||
30 | if [ "$GITDUSER" ]; then | |
31 | if id $GITDUSER >/dev/null 2>&1; then exit 0; fi | |
32 | ||
33 | adduser --system --group --gecos 'userv git daemon' \ | |
34 | --home /etc/userv $GITDUSER | |
35 | fi |