IPとホスト名を変更します
#!/ bin / bash if [`whoami`!= root] then echo"続行するにはrootとしてログインしてください:) " exit fi oip =` grep "IPADDR" / etc / sysconfig / network-scripts / ifcfg-ens33 | awk -F '=' '{print $ 2}' | cut -d '"' -f2` while read -p" Pls input your IPADDRESS、Like 10.119.10.10: "ip do read -p" Your NewIP is $ {ip} 、Make Sure [y | n]: "yn if [[$ {yn} == [Yy]]]; then sed -i" s / $ oip / $ ip / g "/ etc / sysconfig / network-scripts / ifcfg-ens33 echo "IP:" $ {ip} fi read -p "Pls input your's hostname:" hname read -p'Make sure "'$ {hname}'" is hostname [y | n]: 'in if [[$ {in} == [Yy]]]; then sudo hostnamectl set-hostname $ {hname} me サービスネットワークの再起動の 終了しまし た