#!/bin/bash #检测是否为root用户 ];then echo "Must be root can do this." exit fi #检测网络 echo "检测网络中......" /bin/ping www.baidu.com -c &>/dev/null ];then echo "现在网络无法通信,准备设置网络" read -p 'pls enter your ip: ' IP read -p 'pls enter…
centos初始化脚本 添加IP.主机名.挂载/dev/sdb1磁盘 #!/bin/bash # ip=$ hostname=$ if [ -z $ip ] || [ -z $hostname ]; then echo " " echo "Sorry, IP or host is null" echo "# The format : bash set.sh ip hostname" echo "# For example: bash s…