summaryrefslogtreecommitdiff
path: root/goval
blob: 6c598c6f693f0355ebb297ad23462b355ee1d01b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

##
## validate a gophermap -- just pipe in the file
##
## (c) 2018 Vincenzo 'KatolaZ' Nicosia <katolaz@freaknet.org>
##

FIN=${1:-/dev/stdin}

res=$(cat $FIN | sed -n -E -e '/(^[0-9+gIThis].*\t.*\t.*\t|^\.\r$)/! =' | tr '\n' ' ')

[ -z "$res" ] && exit 0
echo "Errors on lines: $res" >&2 && exit 1