summarylogtreecommitdiffstats
path: root/git-git.install
blob: c011b47431428986ffa956b00b1af652a2e1627e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

post_install() {
  if ! getent group git >/dev/null; then
    groupadd --system git
  fi
  if ! getent passwd git >/dev/null; then
    useradd --system -c 'git daemon user' -g git -d / -s /usr/bin/git-shell git
  fi
  if ! grep -qe '^/usr/bin/git-shell$' etc/shells; then
    echo '/usr/bin/git-shell' >> etc/shells
  fi
}

post_upgrade() {
  post_install $1
}

post_remove() {
  sed -i -r '/^\/usr\/bin\/git-shell$/d' etc/shells
}