#!/bin/sh

##
## validate a gophermap -- just pipe in the file
##
## (c) 2018 Vincenzo 'KatolaZ' Nicosia <[email protected]>
##

[ -z "$(cat ${1:-/dev/stdin} | sed -n -E -e '/(^[0-9+gIThis].*  .*      .*      |^\.\r$)/! =' \
       | tr '\n' ' ' | tee /dev/stderr )" ] && exit 0
echo && exit 1