diff options
Diffstat (limited to 'abs/extra/git/git.install')
| -rw-r--r-- | abs/extra/git/git.install | 23 | 
1 files changed, 16 insertions, 7 deletions
diff --git a/abs/extra/git/git.install b/abs/extra/git/git.install index 064eda0..24bc5d7 100644 --- a/abs/extra/git/git.install +++ b/abs/extra/git/git.install @@ -1,12 +1,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 /bin/bash git  +  # 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  } -post_upgrade() { -  post_install $1 +# do not modify user settings (shell) in post-upgrade function! + +post_remove() { +  sed -i -r '/^\/usr\/bin\/git-shell$/d' etc/shells  }  | 
