see Changelog
git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/svn@5 3873ddee-7413-0410-b6c4-c2c57c1ab35a
This commit is contained in:
parent
179303adc9
commit
94c30b3434
3 changed files with 99 additions and 32 deletions
|
@ -19,6 +19,10 @@ cvs
|
||||||
- added support for smc-barricade-7004vbr, see patch #1087989
|
- added support for smc-barricade-7004vbr, see patch #1087989
|
||||||
- added support for sitecom-dc202, see patch #1060119
|
- added support for sitecom-dc202, see patch #1060119
|
||||||
- fixed the error of stripping out '#' in the middle of password, bug #1465932
|
- fixed the error of stripping out '#' in the middle of password, bug #1465932
|
||||||
|
- fixed a couple bugs in sample-etc_rc.d_init.d_ddclient and added some extra auto distro detection
|
||||||
|
- added the validation of values when reading the configuration value.
|
||||||
|
- this fixes a bug when trying to use periods/intervals in the daemon check times, bug #1209743
|
||||||
|
- added timeout option to the IO::Socket call for timing out the initial connection, bug: #1085110
|
||||||
|
|
||||||
3.6.7
|
3.6.7
|
||||||
- modified sample-etc_rc.d_init.d_ddclient.lsb (bug #1231930)
|
- modified sample-etc_rc.d_init.d_ddclient.lsb (bug #1231930)
|
||||||
|
|
50
ddclient
50
ddclient
|
@ -239,13 +239,13 @@ my %builtinfw = (
|
||||||
'skip' => 'WAN.IP.*?Address',
|
'skip' => 'WAN.IP.*?Address',
|
||||||
},
|
},
|
||||||
'netgear-dg834g' => {
|
'netgear-dg834g' => {
|
||||||
'name netgear-dg834g',
|
'name' => 'netgear-dg834g',
|
||||||
'url' => '/setup.cgi?next_file=s_status.htm&todo=cfg_init',
|
'url' => '/setup.cgi?next_file=s_status.htm&todo=cfg_init',
|
||||||
'skip' => '',
|
'skip' => '',
|
||||||
}
|
},
|
||||||
'netgear-wgt624' => {
|
'netgear-wgt624' => {
|
||||||
'name' => 'Netgear WGT624',
|
'name' => 'Netgear WGT624',
|
||||||
'url' => '/RST_st_dhcp.htm'
|
'url' => '/RST_st_dhcp.htm',
|
||||||
'skip' => 'IP Address</B></td><TD NOWRAP width="50%">',
|
'skip' => 'IP Address</B></td><TD NOWRAP width="50%">',
|
||||||
},
|
},
|
||||||
'sveasoft' => {
|
'sveasoft' => {
|
||||||
|
@ -877,7 +877,9 @@ sub _read_config {
|
||||||
warning("program version mismatch; ignoring %s", $file);
|
warning("program version mismatch; ignoring %s", $file);
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
warning("whitespace follows the \\ at the end-of-line.\nIf you meant to have a line continuation, remove the trailing whitespace.")
|
if (/\\\s+$/) {
|
||||||
|
warning("whitespace follows the \\ at the end-of-line.\nIf you meant to have a line continuation, remove the trailing whitespace.");
|
||||||
|
}
|
||||||
|
|
||||||
$content .= "$_\n" unless /^#/;
|
$content .= "$_\n" unless /^#/;
|
||||||
# lines contain passwords are a special case, we don't want to
|
# lines contain passwords are a special case, we don't want to
|
||||||
|
@ -906,12 +908,19 @@ sub _read_config {
|
||||||
s/\s*,\s*/,/g;
|
s/\s*,\s*/,/g;
|
||||||
my @args = split;
|
my @args = split;
|
||||||
|
|
||||||
## verify that keywords are valid..
|
## verify that keywords are valid...and check the value
|
||||||
foreach my $k (keys %locals) {
|
foreach my $k (keys %locals) {
|
||||||
if (!exists $variables{'merged'}{$k}) {
|
if (!exists $variables{'merged'}{$k}) {
|
||||||
warning("unrecognized keyword '%s' (ignored)", $k);
|
warning("unrecognized keyword '%s' (ignored)", $k);
|
||||||
delete $locals{$k};
|
delete $locals{$k};
|
||||||
}
|
} else {
|
||||||
|
my $def = $variables{'merged'}{$k};
|
||||||
|
my $value = check_value($locals{$k}, $def);
|
||||||
|
if (!defined($value)) {
|
||||||
|
warning("Invalid Value for keyword '%s' = '%s'", $k, $locals{$k});
|
||||||
|
delete $locals{$k};
|
||||||
|
} else { $locals{$k} = $value; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (exists($locals{'host'})) {
|
if (exists($locals{'host'})) {
|
||||||
$args[0] = @args ? "$args[0],$locals{host}" : "$locals{host}";
|
$args[0] = @args ? "$args[0],$locals{host}" : "$locals{host}";
|
||||||
|
@ -1679,11 +1688,23 @@ sub geturl {
|
||||||
debug("skipped network connection");
|
debug("skipped network connection");
|
||||||
verbose("SENDING:", $request);
|
verbose("SENDING:", $request);
|
||||||
} elsif ($use_ssl) {
|
} elsif ($use_ssl) {
|
||||||
$sd = IO::Socket::SSL->new(PeerAddr => $peer, PeerPort => $port, Proto => 'tcp', MultiHomed => 1);
|
$sd = IO::Socket::SSL->new(
|
||||||
defined $sd or warning("cannot connect to $peer:$port socket: $@ " . IO::Socket::SSL::errstr());
|
PeerAddr => $peer,
|
||||||
|
PeerPort => $port,
|
||||||
|
Proto => 'tcp',
|
||||||
|
MultiHomed => 1,
|
||||||
|
Timeout => opt('timeout'),
|
||||||
|
);
|
||||||
|
defined $sd or warning("cannot connect to $peer:$port socket: $@ " . IO::Socket::SSL::errstr());
|
||||||
} else {
|
} else {
|
||||||
$sd = IO::Socket::INET->new(PeerAddr => $peer, PeerPort => $port, Proto => 'tcp', MultiHomed => 1);
|
$sd = IO::Socket::INET->new(
|
||||||
defined $sd or warning("cannot connect to $peer:$port socket: $@");
|
PeerAddr => $peer,
|
||||||
|
PeerPort => $port,
|
||||||
|
Proto => 'tcp',
|
||||||
|
MultiHomed => 1,
|
||||||
|
Timeout => opt('timeout'),
|
||||||
|
);
|
||||||
|
defined $sd or warning("cannot connect to $peer:$port socket: $@");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $sd) {
|
if (defined $sd) {
|
||||||
|
@ -3104,3 +3125,8 @@ sub nic_sitelutions_update {
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# vim: ai ts=4 sw=4 tw=78 :
|
# vim: ai ts=4 sw=4 tw=78 :
|
||||||
|
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
#
|
||||||
# ddclient This shell script takes care of starting and stopping
|
# ddclient This shell script takes care of starting and stopping
|
||||||
# ddclient.
|
# ddclient.
|
||||||
|
@ -8,25 +6,61 @@
|
||||||
# chkconfig: 2345 65 35
|
# chkconfig: 2345 65 35
|
||||||
# description: ddclient provides support for updating dynamic DNS services.
|
# description: ddclient provides support for updating dynamic DNS services.
|
||||||
|
|
||||||
[ -f /etc/ddclient/ddclient.conf ] || exit 0
|
CONF=/etc/ddclient/ddclient.conf
|
||||||
|
|
||||||
PATH=/usr/sbin:${PATH}
|
|
||||||
COLUMNS=9999
|
|
||||||
export PATH COLUMNS
|
|
||||||
|
|
||||||
program=ddclient
|
program=ddclient
|
||||||
|
|
||||||
|
[ -f $CONF ] || exit 0
|
||||||
|
|
||||||
|
system=unknown
|
||||||
|
if [ -f /etc/fedora-release ]; then
|
||||||
|
system=fedora
|
||||||
|
elif [ -f /etc/redhat-release ]; then
|
||||||
|
system=redhat
|
||||||
|
elif [ -f /etc/debian_version ]; then
|
||||||
|
system=debian
|
||||||
|
fi
|
||||||
|
|
||||||
|
PID=''
|
||||||
|
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
|
||||||
|
. /etc/init.d/functions
|
||||||
|
PID=`pidofproc $program`
|
||||||
|
else
|
||||||
|
PID=`ps -aef | grep "$program - sleep" | grep -v grep | awk '{print $2}'`
|
||||||
|
fi
|
||||||
|
|
||||||
|
PATH=/usr/sbin:/usr/local/sbin:${PATH}
|
||||||
|
export PATH
|
||||||
|
|
||||||
# See how we were called.
|
# See how we were called.
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
# Start daemon.
|
# Start daemon.
|
||||||
|
DELAY=`grep -v '^\s*#' $CONF | grep -i -m 1 "daemon" | awk -F '=' '{print $2}'`
|
||||||
|
if [ -z "$DELAY" ] ; then
|
||||||
|
DELAY="-daemon 300"
|
||||||
|
else
|
||||||
|
DELAY=''
|
||||||
|
fi
|
||||||
echo -n "Starting ddclient: "
|
echo -n "Starting ddclient: "
|
||||||
ddclient -daemon 300
|
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
|
||||||
|
daemon $program $DELAY
|
||||||
|
else
|
||||||
|
ddclient $DELAY
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
# Stop daemon.
|
# Stop daemon.
|
||||||
echo -n "Shutting down ddclient: "
|
echo -n "Shutting down ddclient: "
|
||||||
kill `ps -aef | awk '/[ \/]perl.*ddclient/ { print $2}'`
|
if [ -n "$PID" ] ; then
|
||||||
|
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
|
||||||
|
killproc $program
|
||||||
|
else
|
||||||
|
kill $PID
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "ddclient is not running"
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
|
@ -34,15 +68,18 @@ case "$1" in
|
||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
pids=`ps -aef | awk '/[ \/]perl.*ddclient/ { print $2}'`
|
if [ "$system" = "fedora" ] || [ "$system" = "redhat" ]; then
|
||||||
if test "$pids"
|
status $program
|
||||||
then
|
else
|
||||||
for p in $pids
|
if test "$PID"
|
||||||
do
|
then
|
||||||
echo "$program (pid $p) is running"
|
for p in $PID
|
||||||
done
|
do
|
||||||
else
|
echo "$program (pid $p) is running"
|
||||||
echo "$program is stopped"
|
done
|
||||||
|
else
|
||||||
|
echo "$program is stopped"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Reference in a new issue