shell完成简单的apache自动部署
#!/bin/bash#by-duwentao
#2017-11-12
html="/var/www/html"
ip=127.24.10.107
if [ `rpm -qa |grep httpd |wc -l` -ne 0];then
yum remove httpd* -y
yum install httpd* -y
else
yum install httpd* -y
fi
if [ ! -f $html/index.html ];then
mkdir -p $html
touch $html/index.html
else
rm -rf $html
mkdir -p $html
touch $html/index.html
chmod 705 $html/index.html
fi
cat >>$html/index.html> /etc/httpd/conf/httpd.conf
service httpd restart
页:
[1]