!/bin/bash
read -p “请输入IP地址” IP
ping -c1 -W1 $IP
if [ $? -eq 0 ];then
echo "yes"
else
echo "NO"
-hostnmae $Hostname
read -p "IP地址" IP
nmcli connection modify ens160 ipv。method manual ipv4.addresses ${IP}/24
ifdown ens160 > /dev/null
ifup ens160 > /dev/null