summaryrefslogtreecommitdiff
path: root/scripts/meta-check
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-17 20:09:33 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-17 20:09:33 -0400
commit4d12729aa4026229e4e118b924cc3b1c75ca214b (patch)
treeabd9a69ec11504844148b1017f9e9601ef7e90b8 /scripts/meta-check
parent4f175a22cf726bfa09652d8d9ca6374785561348 (diff)
write setuid, move things around
Diffstat (limited to 'scripts/meta-check')
-rwxr-xr-xscripts/meta-check60
1 files changed, 0 insertions, 60 deletions
diff --git a/scripts/meta-check b/scripts/meta-check
deleted file mode 100755
index 4add9d3..0000000
--- a/scripts/meta-check
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-# Copyright 2014, 2016 Luke Shumaker <lukeshu@sbcglobal.net>.
-# Copyright 2015 Márcio Alexandre Silva Delgado <coadde@parabola.nu>.
-#
-# This is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This software is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with this manual; if not, see
-# <http://www.gnu.org/licenses/>.
-
-. libremessages
-
-mydir="$(dirname "$0")"
-PATH="$mydir:$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
-
- yamldir="$(ruby -e "load '$mydir/common.rb'; print cfg['yamldir']")"
-
- # Check the user YAML files
- for file in "$yamldir"/*.yml; do
- check-yaml "$file" || ret=$?
- done
-
- msg 'Checking for duplicate usernames'
- dups=($(sed -n 's/^username: //p' -- "$yamldir"/*.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 "$@"