again ..
[scripts/scripts.git] / unreal_update.sh
1 #!/bin/bash
2
3 # to update ip of hackdaworld.dyndns.org in unrealircd.conf
4
5 CONFIGDIR="/etc/opt/unrealircd"
6 BINDIR="/opt/unrealircd/bin"
7 BINARY="ircd"
8
9
10 NEWIP="`host hackdaworld.dyndns.org | awk '{ print $4 }'`"
11
12 # HDWTAG dirty ... but easy :)
13 cat $CONFIGDIR/unrealircd.conf | \
14  sed "s/.* HDWTAG .*/hostname $NEWIP \/* HDWTAG *\//" > $CONFIGDIR/temp
15 mv $CONFIGDIR/temp $CONFIGDIR/unrealircd.conf
16 $BINDIR/$BINARY rehash
17