#!/bin/sh # postinst script for cdc-mapper # # 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 # Code copy from sssd package log() { echo "$*" } insert_nss_entry() { log "Checking NSS setup..." # abort if /etc/nsswitch.conf does not exist if ! [ -e /etc/nsswitch.conf ]; then log "Could not find /etc/nsswitch.conf." return fi # append 'lliurex' to the end of the line if it's not found already sed -i --regexp-extended ' /^group:/ { /\blliurex\b/! s/$/ lliurex/ } ' /etc/nsswitch.conf } case "$1" in configure) if [ -z "$2" ]; then insert_nss_entry fi pam-auth-update --force --package n4d-cdc ;; 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