SUSE Conversations


Updating DynDNS.org Automatically



By: clander

March 8, 2007 3:00 pm

Reads:180

Comments:0

Rating:0

Problem:

Updating DynDNS.org automatically.

Solution:

Install the ddclient package from the package group:

Productivity/Networking/DNS/Utilities

Edit /etc/ddclient.conf to suit your needs.

Create a suitable start/stop script in /etc/init.d. (see the example)

Activate the service in the Yast -> System -> System Services. (Runlevel)

Example:

#! /bin/sh
# Copyright (c) 2002-2004 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Chris Lander <clander@labbs.com>
#         (adapted from existing scripts in /etc/init.d and those supplied with the package ddclient)
#
# /etc/init.d/ddclient
#   and its symbolic link
# /usr/sbin/rcddclient
#
### BEGIN INIT INFO
# Provides:       ddclient
# Required-Start: $network syslog
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Description:    Dynamic DNS service update deamon
### END INIT INFO

DDCLIENT_BIN="/usr/sbin/ddclient"
DDCLIENT_CMD="ddclient"
DDCLIENT_CONF="/etc/ddclient.conf"
PID_FILE="/var/run/ddclient.pid"

. /etc/rc.status
rc_reset

# Check for missing binary
if [ ! -x ${DDCLIENT_BIN} ]; then
echo -n >&2 "ddclient daemon, ${DDCLIENT_BIN} is not installed. "
rc_status -s
exit 5
fi

case "$1" in
start)
echo -n "Starting ddclient daemon "
if [ ! -f ${DDCLIENT_CONF} ]; then
echo -n >&2 "ddclient configuration file, ${DDCLIENT_CONF} does not exist. "
rc_status -s
exit 6
fi
checkproc -p ${PID_FILE} ${DDCLIENT_CMD}
case $? in
0) echo -n "- Warning: daemon already running. " ;rc_failed;rc_status -v;exit;;
esac
${DDCLIENT_CMD} -daemon 300 -file ${DDCLIENT_CONF}
rc_status -v
;;
stop)
echo -n "Shutting down ddclient daemon "
checkproc -p ${PID_FILE} ${DDCLIENT_CMD}
if [[ $? -eq 0 ]]; then
    killproc -p ${PID_FILE} -t 10 ${DDCLIENT_CMD}
else
    echo -n " Warning: daemon not running. "
    rc_failed
fi
rc_status -v
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else 
rc_reset
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
status)
echo -n "Checking for ddclient daemon "
checkproc -p ${PID_FILE} ${DDCLIENT_CMD}
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|}"
exit 1
;;
esac
rc_exit

Environment:

This script was created and tested on Suse 10.0-OSS, using ddclient 3.6.6-2

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Categories: Uncategorized

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS