lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | path_sh=`nv get path_sh` |
| 4 | . $path_sh/global.sh |
| 5 | echo "Info: config-hostname.sh $1 $2 start" >> $test_log |
| 6 | fname=$path_conf"/hostname_mac_file" |
| 7 | fbak=$path_conf"/hostname_mac_file_bak" |
| 8 | |
| 9 | if [ "x$1" = "x" ]; then |
| 10 | echo "insufficient arguments.." |
| 11 | elif [ "x$2" = "x" ]; then |
| 12 | sed -e "/$1/d" $fname > $fbak |
| 13 | cat $fbak > $fname |
| 14 | rm -f $fbak |
| 15 | else # $1 mac, $2 hostname |
| 16 | sed -e "/$1/d" $fname > $fbak |
| 17 | echo "$1 $2" >> $fbak |
| 18 | cat $fbak > $fname |
| 19 | rm -f $fbak |
| 20 | fi |
| 21 | |
| 22 | |