diff --git a/bin/generate-pihole-dns-dhcp.py b/bin/generate-pihole-dns-dhcp.py index dcf5646..d8ebd1c 100755 --- a/bin/generate-pihole-dns-dhcp.py +++ b/bin/generate-pihole-dns-dhcp.py @@ -65,7 +65,7 @@ def GenerateFiles(file): dhcpfile.write('dhcp-option=option:dns-server,'+content['all']['vars']['dns']+'\n\n') dhcpfile.write('dhcp-range='+content['all']['vars']['staticrange']+'\n') with open(dnsfilepath,'w') as dnsfile: - vips=subprocess.run(["/bin/bash", "-c", "echo | openssl s_client -connect "+content['all']['vars']['external_domain']+":443 | openssl x509 -text -noout | grep DNS: | tr ',' '\n' | sed 's/\s\+DNS://' | egrep -iv ^"+content['all']['vars']['external_domain']+" | tr '\n' ' '"], capture_output=True).stdout.decode("utf-8") + vips=subprocess.run(["/bin/bash", "-c", "echo | openssl s_client -connect "+content['all']['vars']['external_domain']+":443 | openssl x509 -text -noout | grep DNS: | tr ',' '\n' | sed 's/\s\+DNS://' | grep -ivE ^"+content['all']['vars']['external_domain']+" | tr '\n' ' '"], capture_output=True).stdout.decode("utf-8") dnsfile.write(content['all']['vars']['webfront']+' '+content['all']['vars']['external_domain']+' '+vips+"\n") # Add DNS entries for each host diff --git a/precommit-hooks/find-large-files b/precommit-hooks/find-large-files index b850403..8648a63 100644 --- a/precommit-hooks/find-large-files +++ b/precommit-hooks/find-large-files @@ -3,7 +3,7 @@ # Limit files in git to 1M. IFS=" " -git ls-files | xargs -n1 du -k {} \; | egrep -v '^[[:digit:]]?[[:digit:]]?[[:digit:]][[:space:]]|venv|\s./.git/' +git ls-files | xargs -n1 du -k | grep -vE '^[[:digit:]]?[[:digit:]]?[[:digit:]][[:space:]]|venv|\s./.git/' if [ $? -ne 1 ]; then echo diff --git a/precommit-hooks/find-passwords-in-files b/precommit-hooks/find-passwords-in-files index 2fad1b1..5260d58 100644 --- a/precommit-hooks/find-passwords-in-files +++ b/precommit-hooks/find-passwords-in-files @@ -19,7 +19,7 @@ saferegex="$saferegex"'|pwpolicies|pwdLastSuccess|pwdAttribute|pwdMaxAge|pwdExpi # Ignore IRC Modules saferegex="$saferegex"'|m_password_hash.so|/quote ns identify|SELECT|password_attribute|SET PASS|SASET PASS' -grep -iEr 'secret|password|pw|passphrase|pass=' roles/*/{files,templates} 2>&1 | egrep -v "$saferegex" +grep -irE 'secret|password|pw|passphrase|pass=' roles/*/{files,templates} 2>&1 | grep -vE "$saferegex" if [ $? -ne 1 ]; then echo echo If these are false positives, you need to add the signature to the whitelist in $0.