summaryrefslogtreecommitdiffstats
path: root/abs/extra/git/git.install
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2018-02-23 21:07:50 (GMT)
committerBritney Fransen <brfransen@gmail.com>2018-02-23 21:07:50 (GMT)
commit8f18100c2bbaaa800b6796e9c23622f85d18ae75 (patch)
tree6d289ecfc8aaca1073478956ba164cd5753238ce /abs/extra/git/git.install
parentcf0a0ff48af9b292e8fc65b3841fd7ad2313d542 (diff)
downloadlinhes_pkgbuild-8f18100c2bbaaa800b6796e9c23622f85d18ae75.zip
linhes_pkgbuild-8f18100c2bbaaa800b6796e9c23622f85d18ae75.tar.gz
linhes_pkgbuild-8f18100c2bbaaa800b6796e9c23622f85d18ae75.tar.bz2
git: update to 2.16
Diffstat (limited to 'abs/extra/git/git.install')
-rw-r--r--abs/extra/git/git.install23
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
}