#!/bin/sh
set -x
#serverlist=`ls -l /usr/local/nginx/conf/vhost/*.conf | awk -F" " '{print $7}'`
serverlist=`ls -l /usr/local/nginx/conf/vhost/*.conf | awk 'NR>2{print $NF}'`
for i in $serverlist;do
grep -ir "server_name" $serverlist | awk -F"server_name" '{print $2}' >> server.txt
done
sort -n server.txt |uniq
grep -ir "server_name" /usr/local/nginx/conf/nginx.conf | awk -F"server_name" '{print $2}'
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。