#!/bin/sh # postinst script for pagure-ev-server # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package # Source debconf library. if test -f /usr/share/debconf/confmodule ; then . /usr/share/debconf/confmodule fi case "$1" in configure) # We run using the same user as gitolite. For more on the # gituser value information, see the gitolite3 package. db_get gitolite3/gituser GITUSER="${RET:-gitolite3}" if test "$GITUSER" != "git" ; then # We must replace the user specified to run the scripts. sed -i -e "s/U=\"git\"/U=\"$GITUSER\"/" /etc/init.d/pagure-ev-server if test -f /lib/systemd/system/pagure-ev-server.service ; then sed -i -e "s/User=git/User=$GITUSER/" \ -e "s/Group=git/Group=$GITUSER/" /lib/systemd/system/pagure-ev-server.service fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0