配置网卡脚本语法错误
#!/bin/sh
echo Try to bring eth0 interface up ...>/dev/s3c2410_serial0
source /etc/nettype.conf
if [ -f /etc/net.conf ];then
source /etc/net.conf
if[$NETTYPE -eq 1];then
ifconfig eth0 down
ifconfig eth0 hw ether $MAC
echo ifconfig eth0 hw ether $MAC >/dev/s3c2410_serial0
ifconfig eth0 $IPADDR netmask $NETMASK up
echo ifconfig eth0 $IPADDR netmask $NETMASK up >/dev/s3c2410_serial0
route add default gw $GATEWAY
echo add default gw $GATEWAY >/dev/s3c2410_serial0
elif[$NETTYPE -eq 2];then
source /etc/wifi.conf
ifconfig eth0 down
igconfig wlan0 $IPADDR netmask $NETMASK up
echo ifconfig wlan0 $IPADDR netmask $NETMASK up>/dev/s3c2410_serial0
route add default gw $GATEWAY
echo route add default gw $GATEWAY>/dev/s3c2410_serial0
iwconfig wlan0 essid "$NETNAME" key "$PASSWORD">/dev/s3c2410_serial0
fi
else
ifconfig eth0 hw ether 10:23:45:679:ab
ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up
route add default gw 192.168.1.2
echo ifconfig eth0 hw ether 10:23:45:679:ab >/dev/tq2440_serial0
echo ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up >/dev/s3c2410_serial0
echo route add default gw 192.168.1.2 >/dev/s3c2410_serial0
fi
echo Done > /dev/s3c2410_serial0
发到这里有点乱 详细见附件
-----------------------------------------------------------------------------------如下错误
Try to bring eth0 interface up ...
/sbin/net_set: line 9: syntax error: "then" unexpected (expecting "fi")
请问是什么原因?应该怎么改???