]> hackdaworld.org Git - scripts/scripts.git/commitdiff
only process if ip changed
authorhackbard <hackbard>
Sun, 14 Dec 2003 01:00:35 +0000 (01:00 +0000)
committerhackbard <hackbard>
Sun, 14 Dec 2003 01:00:35 +0000 (01:00 +0000)
unreal_update.sh

index 876484ccae316e8c706ff90ba4c7f3f1cdece760..6c3095500e4ad56bb651c33692df276604e442ef 100755 (executable)
@@ -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
+