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
+