%post -n portsentry
%{_bindir}/ignore.sh
-DESC="portsentry daemon"; %chkconfig_add
+/sbin/chkconfig --add portsentry
+ls --color=none /var/lock/subsys/portsentry* >/dev/null 2>&1
+if [ $? -eq "0" ]; then
+ /etc/rc.d/init.d/portsentry restart >&2
+else
+ echo "Run \"/etc/rc.d/init.d/portsentry start\" to start portsentry daemon."
+fi
%preun -n portsentry
-%chkconfig_del
+if [ "$1" = "0" ]; then
+ ls --color=none /var/lock/subsys/portsentry* >/dev/null 2>&1
+ if [ $? -eq "0" ]; then
+ /etc/rc.d/init.d/portsentry stop >&2
+ fi
+ /sbin/chkconfig --del portsentry
+fi
%files
%defattr(644,root,root,755)