1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| #!/bin/bash #install apache #v1.0 by arlo 2022/7/20 gateway=192.168.6.254
ping -c1 t.cn &>/dev/null if [ $? -eq 0 ];then yum -y install httpd systemctl start httpd systemctl enable httpd firewall-cmd --permanent --add-port=80/tcp --zone=public firewall-cmd --reload sed -ri s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config setenforce 0 curl http://127.0.0.1 &>/dev/null if [ $? -eq 0 ];then echo "Apache ok..." fi elif ping -c1 $gateway &>/dev/null;then echo "check dns..." else echo "check ip address" fi
|