#
# bpdyndnsd
#
-# chkconfig: 35 80 20
+# chkconfig: 35 90 20
# description: Bullet proof dynamic DNS update daemon.
# processname: bpdyndnsd
# config: /etc/bpdyndnsd/bpdyndnsd.conf
-# pidfile: /var/run/bpdyndnsd.pid
+# pidfile: /var/run/bpdyndnsd/bpdyndnsd.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Binary file
prog=/usr/bin/bpdyndnsd
# PID file
-pidfile=/var/run/bpdyndnsd.pid
+pidfile=/var/run/bpdyndnsd/bpdyndnsd.pid
test -x ${prog} || exit 0
test -e /etc/bpdyndnsd/bpdyndnsd.conf || exit 0
fi
echo -n "Starting $progname: "
- $prog --daemon_mode 1 --syslog 1;
+ daemon --user bpdyndnsd $prog --daemon_mode 1 --syslog 1;
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure
echo
start
}
+online() {
+ echo -n "Switching $progname to online mode: "
+ killproc bpdyndnsd -USR2
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && success || failure
+ echo
+}
+
+online_webcheck() {
+ echo -n "Switching $progname to online mode with webcheck enabled: "
+ killproc bpdyndnsd -RTMIN
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && success || failure
+ echo
+}
+
+offline() {
+ echo -n "Switching $progname to offline mode: "
+ killproc bpdyndnsd -USR1
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && success || failure
+ echo
+}
##
## determine what we should do:
condrestart)
[ -f /var/lock/subsys/bpdyndnsd ] && restart || :
;;
+ online)
+ online
+ ;;
+ online_webcheck)
+ online_webcheck
+ ;;
+ offline)
+ offline
+ ;;
*)
- echo "Usage: bpdyndnsd {start|stop|status|restart|reload|condrestart}"
+ echo "Usage: bpdyndnsd {start|stop|status|restart|reload|condrestart|online|online_webcheck|offline}"
RETVAL=1
esac