X-Git-Url: https://hackdaworld.org/gitweb/?p=scripts%2Fscripts.git;a=blobdiff_plain;f=unreal_update.sh;h=6c3095500e4ad56bb651c33692df276604e442ef;hp=e2246a372d99f0ae1a4e8f6c19456d2e9c233fd1;hb=HEAD;hpb=b8cbc8dc07a49719f01881f64ec8b4a5fb11f66c diff --git a/unreal_update.sh b/unreal_update.sh index e2246a3..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 $NEWIP \/* HDWTAG *\//" > $CONFDIR/temp -mv $CONFDIR/temp $CONFIGDIR/unrealircd.conf -$BINDIR/$BINARY rehash + sed "s/.* HDWTAG .*/hostname ::ffff:$NEWIP; \/* HDWTAG *\//" > $CONFIGDIR/temp +mv $CONFIGDIR/temp $CONFIGDIR/unrealircd.conf +killall -HUP $BINARY + +fi