X-Git-Url: https://hackdaworld.org/gitweb/?p=scripts%2Fscripts.git;a=blobdiff_plain;f=unreal_update.sh;h=6c3095500e4ad56bb651c33692df276604e442ef;hp=876484ccae316e8c706ff90ba4c7f3f1cdece760;hb=HEAD;hpb=e318a0c9b9f56b0b4aef2d5c14a9e22a1843975b 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 +