summaryrefslogtreecommitdiffstats
path: root/abs/extra/git/git.install
blob: 24bc5d7d8aed5f6598bd9062519476fc114f4754 (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() {
  # make git-shell a valid shell
  if ! grep -qe '^/usr/bin/git-shell$' etc/shells; then
    echo '/usr/bin/git-shell' >> etc/shells
  fi

  # make sure the user exists...
  systemd-sysusers git.conf

  # ... and change the shell. This is done only once in post-install
  # function, so an administrative change is persistent.
  chsh --shell /usr/bin/git-shell git > /dev/null
}

# do not modify user settings (shell) in post-upgrade function!

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