rm -f $pidfile /var/lock/subsys/ddclient >/dev/null 2>&1
}
+condrestart() {
+ if [ ! -f /var/lock/subsys/ddclient ]; then
+ msg_not_running "Dynamic DNS Client"
+ return 0
+ fi
+
+ stop
+ start
+}
+
reload() {
if [ ! -f /var/lock/subsys/ddclient ]; then
msg_not_running "Dynamic DNS Client"
stop
start
;;
+ try-restart)
+ condrestart
+ ;;
reload|force-reload)
reload
;;
exit $?
;;
*)
- msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+ msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
exit 3
esac
%post
/sbin/chkconfig --add %{name}
-%service %{name} restart "%{name} daemon"
+if [ "$1" = "2" ]; then
+ %service %{name} try-restart "%{name} daemon"
+fi
%preun
if [ "$1" = "0" ]; then