blob: bf4c5cc146390a72d558b60f11fefe38e0c33041 [file] [log] [blame]
xf.li86118912025-03-19 20:07:27 -07001#!/bin/sh
2
3path_sh=`nv get path_sh`
4. $path_sh/global.sh
5echo "Info: config-hostname.sh $1 $2 start" >> $test_log
6fname=$path_conf"/hostname_mac_file"
7fbak=$path_conf"/hostname_mac_file_bak"
8
9if [ "x$1" = "x" ]; then
10 echo "insufficient arguments.."
11elif [ "x$2" = "x" ]; then
12 sed -e "/$1/d" $fname > $fbak
13 cat $fbak > $fname
14 rm -f $fbak
15else # $1 mac, $2 hostname
16 sed -e "/$1/d" $fname > $fbak
17 echo "$1 $2" >> $fbak
18 cat $fbak > $fname
19 rm -f $fbak
20fi
21
22