shell脚本自动修改centos7网卡名称
centos7的网卡名字默认是eno跟数字(如eno16780032),看着太不爽了,我习惯用eth0接口,故想用脚本自动修改,脚本修改网卡名后会自动重启系统生效.
脚本内容:
#!/bin/bash
#
function RENMAE_NIC()
{
local _NICNAME=$(ip addr | grep "^2"|awk -F ": " '{print $2}')
if [[ ${_NICNAME} != "eth0" ]];then
echo -e "\e[40;31m The nic name is [\e[40;31m${_NICNAME}\e[4...

