summaryrefslogtreecommitdiff
path: root/bin/meta-check
diff options
context:
space:
mode:
Diffstat (limited to 'bin/meta-check')
-rwxr-xr-xbin/meta-check41
1 files changed, 0 insertions, 41 deletions
diff --git a/bin/meta-check b/bin/meta-check
deleted file mode 100755
index 16994ce..0000000
--- a/bin/meta-check
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-. libremessages
-
-PATH="$(dirname "$0"):$PATH"
-
-check-yaml() {
- file=$1
- msg 'Inspecting %q' "$file"
- norm=$(mktemp --tmpdir)
- trap "rm -f -- $(printf '%q' "$norm")" RETURN
- meta-normalize-stdio < "$file" > "$norm" || return $?
- colordiff -u "$file" "$norm" || return $?
-}
-
-main() {
- declare -i ret=0
-
- # Check the user YAML files
- for file in users/*.yml; do
- check-yaml "$file" || ret=$?
- done
-
- msg 'Checking for duplicate usernames'
- dups=($(sed -n 's/^username: //p' -- users/*.yml| sort | uniq -d))
- if (( ${#dups[@]} )); then
- error 'Duplicate usernames:'
- plain '%s' "${dups[@]}"
- ret=1
- fi
-
- msg 'Checking PGP keys'
- if pgp-list-keyids | grep -Ev '^(trusted|secondary|revoked)/[a-z][a-z0-9-]* [0-9A-F]{40}$'; then
- error 'Bad pgp keys ^^^'
- ret=1
- fi
-
- return $ret
-}
-
-main "$@"