#!/bin/bash

#########################################

. /var/lib/autoyast-cc/libcc

#########################################

CFG="/etc/pwdutils/logging"
[ ! -f "$CFG" ] && {
	cc_echo "pwdutils not installed - skipping configuration changes"
	cc_exit 0
}

AUDIT='
#
## CC Configuration START
#
# Enable of auditing with the utilities of {group|user}{add|mod|del}.
#
# You MAY disable this configuration if auditing of the actions of these
# tools are considered irrelevant for maintaining the audit trail.
#
audit
#
## CC configuration END
'

#############################################
# actual work

trap "cc_exec_log rm -f $CFG.$$" 0 1 2 3 15

perl -ne 'print unless /CC Configuration START/../CC configuration END/' < $CFG >$CFG.$$
printf "$AUDIT\n" >> $CFG.$$
cc_replace $CFG.$$ $CFG
cc_echo "$CFG brought into CC evaluated configuration"

cc_exit 0
