Actually I'm aware of that
I just wanted to show how it should have been from the start. The files in /etc/dhcpc/ directory shouldn't have been there in the first place. But you are right about my method not being the most simple. It's a fix and tutorial combo 
The best way to fix this would be to change the script so that it takes the hostname from the /etc/HOSTNAME file, and if a domain is found by dhcp it would only append the domain to the existing hostname in the /etc/HOSTNAME.
I would change the following:
Code:
# Set hostname by using DHCP response
ls -aA1b /etc/dhcpc | egrep ".info\$" | while read INFOFILE; do
# the next line won't affect rc.M variables, because it's in >while read< loop
. /etc/dhcpc/$INFOFILE
echo "bt."$DOMAIN >/etc/HOSTNAME
break
done
Into the following:
Code:
# Set hostname by using DHCP response
ls -aA1b /etc/dhcpc | egrep ".info\$" | while read INFOFILE; do
# the next line won't affect rc.M variables, because it's in >while read< loop
. /etc/dhcpc/$INFOFILE
HOSTNAME=$(cat /etc/HOSTNAME | head -n 1 | cut -d . -f 1)
[ "$HOSTNAME" == "" ] && HOSTNAME="bt"
echo $HOSTNAME"."$DOMAIN >/etc/HOSTNAME
break
done
This solution is more universal I think...