You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
376 B

#!/bin/sh
. /etc/init.d/globals
case $1 in
start)
if [ ! -f /etc/hostname ]; then
box_model=$(grep "^box_model=" /.version | cut -d'=' -f2)
hwaddr=$(ifconfig eth0 | awk '/HWaddr/ { split($5,v,":"); print v[4] v[5] v[6] }')
echo "${box_model}.NI-${hwaddr}" > /etc/hostname
fi
hostname -F /etc/hostname
;;
*)
echo "[$BASENAME] Usage: $0 {start}"
;;
esac