怎样实现sh apache.sh 端口,调用脚本改端口?
yum install httpd -y
systemctl start httpd
vim apache.sh
#!/bin/bash
[ -z "$1" ] && {
echo "Error:please input number following script"
exit
}
sed "/^Listen/cListen $1" -i /etc/httpd/conf/httpd.conf
systemctl restart httpd