shell-script - shell 如何获取 nginx 配置文件位置?
时间:2021-04-19 15:38:16
收藏:0
阅读:0
通过nginx -t
获得
nginx=`nginx -t 2>&1 | grep configuration`
if [ ! -z "$nginx" ];then
nginxtmp="${nginx#*file}"
nginxf="${nginxtmp%test*}"
echo $nginxf
fi
评论(0)