summaryrefslogtreecommitdiff
path: root/net/ddup/files/patch-ddupcron.sh
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2003-02-05 12:21:22 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2003-02-05 12:21:22 +0000
commit89d3eeaeca6e97fe488c2f110971d197f5c0baa3 (patch)
treec55916e913414c61c2fe31b431162ef1e003f750 /net/ddup/files/patch-ddupcron.sh
parentUpdate to 2.1024 (diff)
Update: net/ddup (3.0.1)
this patch set updates ddup to make it conformant w/ http://clients.dyndns.org/devel/query.php major changes where done by robert@castley.com, so, don't forget to give him credits in the CVS logs. PR: ports/40966 Submitted by: Cyrille Lefevre <cyrille.lefevre@laposte.net>
Notes
Notes: svn path=/head/; revision=74852
Diffstat (limited to 'net/ddup/files/patch-ddupcron.sh')
-rw-r--r--net/ddup/files/patch-ddupcron.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/net/ddup/files/patch-ddupcron.sh b/net/ddup/files/patch-ddupcron.sh
index ed354d7afff8..52d2a0d7da54 100644
--- a/net/ddup/files/patch-ddupcron.sh
+++ b/net/ddup/files/patch-ddupcron.sh
@@ -1,6 +1,6 @@
---- ddupcron.sh.orig Mon Oct 23 02:11:48 2000
-+++ ddupcron.sh Thu Nov 2 14:16:39 2000
-@@ -2,19 +2,23 @@
+--- ddupcron.sh.orig Sun Oct 22 19:11:48 2000
++++ ddupcron.sh Thu Jul 25 06:21:51 2002
+@@ -2,26 +2,30 @@
# Define the host to be updated as 1st arguement to script
if [ -z $1 ]; then
@@ -12,18 +12,30 @@
fi
# Define interface to grep address from
-IFACE="eth0"
+-IFCHECK=$(/sbin/ifconfig $IFACE|grep ask|awk '{print $2}'|cut -d ':' -f2)
+if [ -z $2 ]; then
+ IFACE=fxp0
+else
+ IFACE=$2
+fi
- IFCHECK=$(/sbin/ifconfig $IFACE|grep ask|awk '{print $2}'|cut -d ':' -f2)
++IFCHECK=$(/sbin/ifconfig $IFACE|awk '/netmask/{print $2; exit}')
# Define where we should store last IP
- IPFILE="/tmp/ddupip"
+-IPFILE="/tmp/ddupip"
++IPFILE="/var/db/ddup.ip"
IPCHECK=$(cat $IPFILE)
++FILECHECK=$(find $IPFILE -mtime -25)
++
# Define path to ddup and ddup arguments (except --host)
-DDUP_PATH="/home/ddup/ddup"
-+DDUP_PATH="!!PREFIX!!/sbin/ddup"
++DDUP_PATH="%%PREFIX%%/sbin/ddup"
DDUP_ARGS="--debug"
-
+-
+-if [ "$IFCHECK" = "$IPCHECK" ]; then
++if [ "$IFCHECK" = "$IPCHECK" ] && [ "x$FILECHECK" != x ]; then
+ echo "looks like we are still the same ip"
+ else
+ $DDUP_PATH --host $HOST $DDUP_ARGS
+ echo "$IFCHECK" > $IPFILE
+ fi
+-