Updates for latest inspircd & anope

This commit is contained in:
2025-09-29 16:33:05 -05:00
parent a14dfd6562
commit 78af592485
16 changed files with 77 additions and 81 deletions

View File

@@ -1,12 +1,12 @@
#!/usr/bin/bash
# File: find-bad-ipam
#
#
# Description: This file finds bad IPAM entries in an inventory.
#
#
# Package: AniNIX/Ubiqtorate
# Copyright: WTFPL
#
#
# Author: DarkFeather <ircs://aninix.net:6697/DarkFeather>
file="examples/msn0.yml"
@@ -14,7 +14,7 @@ file="examples/msn0.yml"
function findBadTerm() {
### Check for a term to be duplicated.
# param file: the file
# param term: the term to search for duplicates
# param term: the term to search for duplicates
file="$1"
term="$2"
results="$(grep -i "$term:" "$file" | tr '[[:upper:]]' '[[:lower:]]' | sed 's/\s+'"$term"':\s*//' | sort | uniq -c | grep -vE '^\s+1\s+' )"
@@ -26,7 +26,7 @@ function findBadTerm() {
fi
}
function Usage() {
function Usage() {
### Helptext
# param retcode: what to return
retcode="$1"

View File

@@ -0,0 +1,17 @@
#!/bin/bash
export IFS="
"
retcode=0
for macline in `grep -E '^\s+mac: ' examples/*.yml`; do
if [ "${macline}" != "${macline,,}" ]; then
mac="$( echo "${macline}" | awk '{ print $2; }')"
retcode=1
echo "${mac} has mismatched case -- should be lower."
sed -i "s/${mac}/${mac,,}/g" examples/*.yml
echo "Attempted replacement."
fi
done
exit $retcode

View File

@@ -28,3 +28,12 @@ if [ $? -ne 1 ]; then
echo Otherwise, convert any files above to templates and encode the passphrase into your vault.
exit 1;
fi
IFS="
"
for i in `ansible-vault decrypt --output - ${ANSIBLE_VAULT_FILE} | sed 's/\s\?-\?\s\?[A-Za-z0-9_]\+://' | grep -vE '\||password|^\s\?$|#|https://' | sed "s/^ \+['\"]\?//" | sed "s/[\"']\s\?//" | sort | uniq`; do
grep -rl "${i}" . 2>/dev/null
if [ $? -ne 1 ]; then
echo "A secret starting with $(echo "$i" | cut -c 1-7) was found in the files above."
exit 1;
fi
done

View File

@@ -0,0 +1,4 @@
if [ `git ls-files -m | grep precommit-hooks/ | wc -l` != '0' ]; then
echo 'Hooks have changed and need to be added. Run `git add precommit-hooks`'
exit 1
fi

View File

@@ -1,7 +0,0 @@
#!/bin/bash
# pre-commit hook to use ansible-lint to check our playbooks.
for file in `find ../playbooks/ -type f`; do
ansible-lint "$file"
done