脚本的目的是修改 IP,MAC,网关地址!
部分内容如下:
#!/bin/sh
file=/usr/local/Boromax/config/mydefault.ini
if [ "$1" == "ip" ] ;then
echo "now we to set current ip=$2 to $file..."
IP_back=`sed -n '/^IP/s/IP= *//p' $file`
sed -i 's/IP='$IP_back'/IP='$2'/g' $file
......
......
elif [ "$1" == "mac" ] ;then
echo "now we to set mac=$2 to $file... "
MAC_back=`sed -n '/^MAC/s/MAC= *//p' $file`
sed -i 's/MAC='$MAC_back'/MAC='$2'/g' $file
fi