- 论坛徽章:
- 0
|
原帖由 briangao 于 2007-5-1 00:35 发表
try:
INTERNUM=`ifconfig -a | grep "ether" | wc -l`
谢谢!
不过还是多帮帮看看,这个客户端依然不能继续,如下:
#if more than ONE eth installed, have to select one(只有一个“rtls0”)
CMPNUM=0
if [ "$INTERNUM" -gt "$CMPNUM" ]; then
ifconfig -a | grep "ether" | awk '
BEGIN {
i=0;
printf("All names of your net interface installed\n");
printf("-----------------------------------------\n");
}
{
printf("\t%s\t%d\n", $1, i);
i++;
}'
echo -n "Input one name to hace access with Internet (eth0): "
read INTERNAME
if [ ! $INTERNAME ]; then #default name is eth0
INTERNAME="eth0"
fi
#if the name input is correct or not
TMP_NUM=`ifconfig -a | grep "ether" | grep "$INTERNAME" | wc -l`
if [ $TMP_NUM -eq 0 ]; then
echo "You have input an invalid name of net interface"
return 1
fi
else
INTERNAME=`ifconfig -a |grep "ether" | awk '{print $1}'`
fi
echo "The name of interface is: " $INTERNAME
----
无论输入什么均有错误提示:
把“eth0"都改为"rtls0"一样
这个是在linxu下客户端,用过可以上网,但在solaris下不知该怎么办,劳驾,帮帮, |
|