#!/bin/sh
# check if nginx have .git danger
grep -rn server_name /etc/nginx/conf.d/ | awk '{print $NF}' | awk -F ';' '{print $1}' | sort -n | uniq -c| sort -n | awk '{print $2}' | while read line ; do
   tag=$(curl http://$line/.git/config 2>&1 | grep gitea.drugeyes.vip | wc -l)
   if [ $tag -ne 0 ];then
       echo http://$line is danger
   fi
   tag=$(curl https://$line/.git/config 2>&1 | grep gitea.drugeyes.vip | wc -l)
   if [ $tag -ne 0 ];then
       echo https://$line is danger
   fi

done

