#!/usr/bin/perl -w

## get the full hostname
## fixes dhcp glitch which only uses gives the hostname part

($x,$x,$ip)=split(/ /,`ifconfig bond0|grep addr:|tr -s " "`);
$ipaddress=substr($ip, 5);
chomp(@_=split(/ /,`host $ipaddress`));
$_=substr($_[4],0,-1);
open ($OUT,">/etc/sysconfig/network")||die "can't open network file";

print $OUT "NETWORKING=yes\n";
print $OUT "HOSTNAME=$_\n";
`hostname $_`;
