chiark / gitweb /
8609c73671c683f9447ffc7e09311808a8af88f1
[userv-utils.git] / debian / userv-git-daemon / postinst
1 #!/bin/sh
2 set -e
3
4 # Copyright (C) 2010 Ian Jackson
5 #
6 # This file is part of userv-git-daemon, part of userv-utils
7 #
8 # This is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with userv-utils; if not, write to the Free Software
20 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22 GITDUSER=git
23
24 defaults=/etc/default/userv-git-daemon
25 if test -f $defaults; then . $defaults; fi
26
27 if [ "$GITDUSER" ]; then
28         if id $GITDUSER >/dev/null 2>&1; then exit 0; fi
29
30         adduser --system --group --gecos 'userv git daemon' \
31                 --home /etc/userv $GITDUSER
32 fi