centos6 多段Ip添加shell脚本
#!/bin/bash export device=`ifconfig|grep eth0|head -n 1|awk '{print ($1)}'` export ipcfg_pre="/etc/sysconfig/network-scripts/ifcfg-eth1-range" awktmp=`mktemp` msg=`mktemp` ip_txt=`mktemp` ifcfgs="$(find ${ipcfg_pre%/*} -name ${ipcfg_pre##*/}*)" if test ! -z "$ifcfgs";then echo "发现如下已有配置文件是否删除(yes/no)?" echo "$ifcfgs" select var in "yes" "no" do if test "$var" = "yes";then rm -f $ifcfgs break; else break; fi done fi #脚本保存进 临时文件 不再使用a.awk文件。 cat >$awktmp <<EOF #!/usr/bin/awk -f BEGIN{ ipc...
