1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| $ basepath=$(cd `dirname $0`; pwd) $ echo $basepath
$ LAN_IP=$(ip addr| grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|cut -d "/" -f 1 | awk '{print $1}' | head -1) $ echo $LAN_IP
$ systemctl stop firewalld && systemctl disable firewalld
$ getenforce | grep -iq 'Enforcing' && setenforce 0 $ sed -i 's|SELINUX=\(.*\)|SELINUX=disabled|g' /etc/selinux/config
$ result=$(rpm -qa|egrep "httpd|ansible|createrepo") $ echo $? 1
|