#!/bin/sh

if [ "$1" = "start" ]
then
    if [ -x /bin/hostname -o -x /usr/bin/hostname ]
    then
        echo Setting the hostname to $HOSTNAME
        hname=$( cat /proc/cpuid )
        if [ -e /etc/platform/sys/SERIAL ]
        then
           hname=$( grep ENCLOSURE /etc/platform/sys/SERIAL | awk -F '#' '{ print $2 }' )
        fi
        hostname $hname
    fi
fi
