Sophie

Sophie

distrib > PLD > th > x86_64 > by-pkgid > 772ca687e0fc37079c46a3aa42a8b01f > scriptlet

bacula-common-11.0.6-2.x86_64.rpm

PREIN

/bin/sh

 
 
if /usr/bin/getgid bacula > /dev/null 2>&1; then 
	if [ "`/usr/bin/getgid bacula`" != "136" ]; then 
		echo "Error: group bacula doesn't have gid=136. Correct this before installing bacula-common." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding group bacula GID=136." 
	/usr/sbin/groupadd -g 136 -r bacula 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : 
fi;

 
 
 
if [ -n "`/bin/id -u bacula 2>/dev/null`" ]; then 
	if [ "`/bin/id -u bacula`" != "136" ]; then 
		echo "Error: user bacula doesn't have uid=136. Correct this before installing bacula-common." 1>&2 
		exit 1 
	fi 
else 
	echo "Adding user bacula UID=136." 
	/usr/sbin/useradd \
		 \
		-u 136 \
		-r \
		-d /var/lib/bacula \
		-s /bin/false \
		-c "Bacula User"\
		-g bacula \
		 \
		 \
		bacula 1>&2 || exit $? 
	[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || : 
fi;

POSTIN

/bin/sh
/sbin/ldconfig

echo "Updating bacula passwords and names..." |  ( 
RPM_SCRIPTVERBOSITY=5 
[ -r /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm 
if [ -x /usr/bin/banner.sh ]; then 
	CMD="/usr/bin/banner.sh  $([ $RPM_SCRIPTVERBOSITY -ge 5 ] && echo -s) -M bacula" 
else 
	CMD="cat" 
fi 
eval $CMD ) 

cd /etc/bacula 
for f in *-password; do 
	if [ ! -s $f ]; then 
		openssl rand -base64 33 > $f 
	fi 
	p=$(cat $f) 
	for cf in *.conf *.conf.rpmnew; do 
		[ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : 
	done 
done 
for cf in *.conf *.conf.rpmnew; do 
	[ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : 
done

POSTUN

/bin/sh
/sbin/ldconfig
if [ "$1" = "0" ]; then
	/usr/lib/rpm/user_group.sh user del bacula
	/usr/lib/rpm/user_group.sh group del bacula
fi

Triggers

bacula-common < 5.0.1-2

/bin/sh
find /etc/bacula/bat.conf* -perm /007 -print0 2>/dev/null | xargs -0 -r chmod 600 || :