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.
17 lines
305 B
17 lines
305 B
#!/bin/sh
|
|
|
|
. /etc/init.d/globals
|
|
|
|
case $1 in
|
|
start)
|
|
if [ ! -f /etc/hostname ]; then
|
|
hwaddr=$(ifconfig eth0 | awk '/HWaddr/ { split($5,v,":"); print v[4] v[5] v[6] }')
|
|
echo "NI-AX-${hwaddr}" > /etc/hostname
|
|
fi
|
|
|
|
hostname -F /etc/hostname
|
|
;;
|
|
*)
|
|
echo "[$BASENAME] Usage: $0 {start}"
|
|
;;
|
|
esac
|
|
|