PREUN
/bin/sh
if [ $1 = 0 ]; then
/sbin/service dhcpd stop >/dev/null 2>&1
/sbin/service dhcpd6 stop >/dev/null 2>&1
/sbin/service dhcrelay stop >/dev/null 2>&1
/sbin/chkconfig --del dhcpd
/sbin/chkconfig --del dhcpd6
/sbin/chkconfig --del dhcrelay || :
fi
POSTIN
/bin/sh
sampleconf="#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# see 'man 5 dhcpd.conf'
#"
contents="$(/bin/cat /etc/dhcp/dhcpd.conf)"
prevconf="/etc/dhcpd.conf"
if [ ! -z "${prevconf}" ]; then
if [ ! -f /etc/dhcp/dhcpd.conf -o "${sampleconf}" = "${contents}" ]; then
/bin/cp -a ${prevconf} /etc/dhcp/dhcpd.conf >/dev/null 2>&1
/bin/mv ${prevconf} ${prevconf}.rpmsave >/dev/null 2>&1
if [ -x /sbin/restorecon ]; then
/sbin/restorecon /etc/dhcp/dhcpd.conf >/dev/null 2>&1
fi
fi
fi
/sbin/chkconfig --add dhcpd
/sbin/chkconfig --add dhcpd6
/sbin/chkconfig --add dhcrelay || :
POSTUN
/bin/sh
if [ $1 -ge 1 ]; then
/sbin/service dhcpd condrestart >/dev/null 2>&1
/sbin/service dhcpd6 condrestart >/dev/null 2>&1
/sbin/service dhcrelay condrestart >/dev/null 2>&1 || :
fi