shell脚本自动安装httpd服务并修改端口

自动安装http服务,并且修改其端口为脚本后边的第一串字符

#!/bin/bash
yum install httpd.x86_64 -y &>/dev/null; 把安装过程中的结果导入垃圾箱
sed -i "/^Listen/cListen $1" /etc/httpd/conf/httpd.conf
echo the LIsten is changed
sed -ne '42p' /etc/httpd/conf/httpd.conf
systemctl restart httpd

猜你喜欢

转载自blog.csdn.net/jay_youth/article/details/80816555