From b0c449fd3ff643c6c8599c7857564f70d28bc22e Mon Sep 17 00:00:00 2001 From: wimpunk Date: Sat, 30 Sep 2006 13:15:58 +0000 Subject: [PATCH] Added initscript for Ubuntu (posted by Paolo Martinelli) git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk@22 3873ddee-7413-0410-b6c4-c2c57c1ab35a --- svn/Changelog | 1 + svn/sample-etc_rc.d_init.d_ddclient.ubuntu | 47 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 svn/sample-etc_rc.d_init.d_ddclient.ubuntu diff --git a/svn/Changelog b/svn/Changelog index e693d44..48655af 100644 --- a/svn/Changelog +++ b/svn/Changelog @@ -2,6 +2,7 @@ Changelog 3.7.1 - URL of zoneedit has changed (see bug #1558483) +- Added initscript for Ubuntu (posted by Paolo Martinelli) 3.7.0 - Added vi tag diff --git a/svn/sample-etc_rc.d_init.d_ddclient.ubuntu b/svn/sample-etc_rc.d_init.d_ddclient.ubuntu new file mode 100755 index 0000000..93b0ba4 --- /dev/null +++ b/svn/sample-etc_rc.d_init.d_ddclient.ubuntu @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Start ddclient that provides support for updating dynamic DNS services. +# +# Submitted by paolo martinelli + +DDCLIENT=/usr/sbin/ddclient +CONF=/etc/ddclient/ddclient.conf +PIDFILE=/var/run/ddclient.pid + +test -x $DDCLIENT || exit 0 +test -f $CONF || exit 0 + +. /lib/lsb/init-functions + +case "$1" in +start) +log_begin_msg "Starting ddclient..." +DELAY=`grep -v '^\s*#' $CONF | grep -i -m 1 "daemon" | awk -F '=' '{print $2}'` +if [ -z "$DELAY" ] ; then +DELAY="-daemon 300" +else +DELAY='' +fi +start-stop-daemon -S -q -p $PIDFILE -x $DDCLIENT -- $DELAY +log_end_msg $? +;; +stop) +if [ -f $PIDFILE ] ; then +log_begin_msg "Stopping ddclient..." +start-stop-daemon -K -q -p $PIDFILE +log_end_msg $? +rm -f $PIDFILE +fi +;; +restart|reload|force-reload) +$0 stop +$0 start +;; +*) +log_success_msg "Usage: $0 {start|stop|restart|reload|force-reload}" +exit 1 +;; +esac + +exit 0 +