- 论坛徽章:
- 0
|
再帮我看下了.
执行后又出错了.
spawn ping -c 1 -s 1 192.168.100.1
PING 192.168.100.1 (192.168.100.1) 1(29) bytes of data.
9 bytes from 192.168.100.1: icmp_seq=0 ttl=128
--- 192.168.100.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
spawn ping -c 1 -s 1 192.168.10.1
PING 192.168.10.1 (192.168.10.1) 1(29) bytes of data.
./fw: line 7: [: eq: binary operator expected
./fw: line 18: [: ne: binary operator expected
./fw: line 21: [: ne: binary operator expected
fw的脚本如下:
#!/bin/sh
/111/netwatch.exp 192.168.100.1
result1=$?
/111/netwatch.exp 192.168.10.1
result2=$?
if [ "$result1" eq 0 ] && [ "$result2" eq 0 ]
then
# ...................
if [ -e /var/run/lost-connection ]
then
rm /var/run/lost-connection
fi
elif [ "$result1" ne 0 ]
then
/sbin/ip route replace via 192.168.10.1 dev eth1
elif [ "$result2" ne 0 ]
then
/sbin/ip route replace via 192.168.100.1 dev eth1 talbe 100
else
echo "yy" |
|