From 976e17bc72a52413bac776f93175d46fa0b2fdf8 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 14 Dec 2003 01:00:35 +0000 Subject: [PATCH] only process if ip changed --- unreal_update.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/unreal_update.sh b/unreal_update.sh index 876484c..6c30955 100755 --- a/unreal_update.sh +++ b/unreal_update.sh @@ -9,9 +9,15 @@ BINARY="ircd" NEWIP="`host hackdaworld.dyndns.org | awk '{ print $4 }'`" -# HDWTAG dirty ... but easy :) +# get CURRENTIP +CURRENTIP="`grep HDWTAG $CONFIGDIR/unrealircd.conf | awk '{ print $2 }'`" + +if [ "$CURRENTIP" != "$NEWIP" ]; then + cat $CONFIGDIR/unrealircd.conf | \ sed "s/.* HDWTAG .*/hostname ::ffff:$NEWIP; \/* HDWTAG *\//" > $CONFIGDIR/temp mv $CONFIGDIR/temp $CONFIGDIR/unrealircd.conf killall -HUP $BINARY +fi + -- 2.39.2