#!/bin/shETHCONF=/etc/sysconfig/network-scripts/ifcfg-eth0HOSTS=/etc/hostsNETWORK=/etc/sysconfig/network NETMASK=255.255.255.0###function Change_ip (){grep "dhcp" $ETHCONFif [ $? -eq 0 ];th
#!/bin/bashDEFAULTNAME=`ls /etc/sysconfig/network-scripts/ifcfg-en*`EXPECTNAME=ifcfg-eth0sed -i 's/DEVICE.*/DEVICE=eth0/g' $DEFAULTNAMEsed -i 's/ONBOOT.*/ONBOOT=yes/g' $DEFAULTNAMEmv $INITIALNAME /etc
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号