1. 通过ifconfig取得IP地址
ifconfig ppp0|awk -F"[ :]" '/inet/{print $16}'
adsl0=`ifconfig ppp0|awk -F"[ :]" '/inet/{print $16}'`
2,变量
#!/bin/sh
CMD="route add -net"
CTCIF="gw 172.0.0.1"
${CMD} 58.14.0.0/15 ${CTCIF}
${CMD} 58.24.0.0/15 ${CTCIF}
阅读(1232) | 评论(0) | 转发(0) |