e2246a372d99f0ae1a4e8f6c19456d2e9c233fd1
[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 *\//" > $CONFDIR/temp
15 mv $CONFDIR/temp $CONFIGDIR/unrealircd.conf
16 $BINDIR/$BINARY rehash
17