<commit_before>#!/bin/bash

cont=`echo $1 |cut -f1 -d:`
fqdn=`echo $1 |cut -f2 -d:`
port=`echo $1 |cut -f3 -d:`
host=`echo $fqdn |cut -f1 -d.`

protos=`echo $1 $2  |cut -f4 -d:`

	if test -z "$protos"
		then
			protos="http"
	fi

 for proto in $protos
 do
	if test "https" = $proto
		then
		 	if test -f /etc/nginx/ssl/certs/$fqdn.crt
		 		then
		 			certname=$fqdn
		 		else
		 			dn=`echo $fqdn | awk -F.  '{for(i=1;i<2;i++) $i="";print}' |tr ' ' '.' |sed "/./s///"`
		 			if test -f /etc/nginx/ssl/certs/$dn.crt
		 				then
		 					certname=$dn
		 				else
		 					certname="engines"
		 			fi
		 			
		 	fi
	fi	
		

 cat /home/tmpls/${proto}_site.tmpl | sed "/CERTNAME/s//$certname/"  | sed "/SERVER/s//$host/" | sed "/FQDN/s//$fqdn/" | sed "/PORT/s//$port/" >/tmp/${proto}_$fqdn.site
cp /tmp/${proto}_$fqdn.site /etc/nginx/sites-enabled/

done
 if test -f /tmp/https_$fqdn.site 
	then
		if test ! -f /tmp/http_$fqdn.site
			then
				cat /home/tmpls/http_to_https.tmpl | sed "/CERTNAME/s//$certname/"  | sed "/SERVER/s//$host/" | sed "/FQDN/s//$fqdn/" | sed "/PORT/s//$port/" >/tmp/http_$fqdn.site
				cp /tmp/http_$fqdn.site /etc/nginx/sites-enabled/
		fi
fi
		
service nginx restart
<commit_msg>changed to reload instead of restart<commit_after>#!/bin/bash

cont=`echo $1 |cut -f1 -d:`
fqdn=`echo $1 |cut -f2 -d:`
port=`echo $1 |cut -f3 -d:`
host=`echo $fqdn |cut -f1 -d.`

protos=`echo $1 $2  |cut -f4 -d:`

	if test -z "$protos"
		then
			protos="http"
	fi

 for proto in $protos
 do
	if test "https" = $proto
		then
		 	if test -f /etc/nginx/ssl/certs/$fqdn.crt
		 		then
		 			certname=$fqdn
		 		else
		 			dn=`echo $fqdn | awk -F.  '{for(i=1;i<2;i++) $i="";print}' |tr ' ' '.' |sed "/./s///"`
		 			if test -f /etc/nginx/ssl/certs/$dn.crt
		 				then
		 					certname=$dn
		 				else
		 					certname="engines"
		 			fi
		 			
		 	fi
	fi	
		

 cat /home/tmpls/${proto}_site.tmpl | sed "/CERTNAME/s//$certname/"  | sed "/SERVER/s//$host/" | sed "/FQDN/s//$fqdn/" | sed "/PORT/s//$port/" >/tmp/${proto}_$fqdn.site
cp /tmp/${proto}_$fqdn.site /etc/nginx/sites-enabled/

done
 if test -f /tmp/https_$fqdn.site 
	then
		if test ! -f /tmp/http_$fqdn.site
			then
				cat /home/tmpls/http_to_https.tmpl | sed "/CERTNAME/s//$certname/"  | sed "/SERVER/s//$host/" | sed "/FQDN/s//$fqdn/" | sed "/PORT/s//$port/" >/tmp/http_$fqdn.site
				cp /tmp/http_$fqdn.site /etc/nginx/sites-enabled/
		fi
fi
		
service nginx reload

{'fraction_non_alphanumeric': 0.20644095788604458, 'fraction_numerical': 0.00990916597853014, 'mean_word_length': 2.2306666666666666, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2136878', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1097, 'n_words': 235}