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
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!