feat(user/bkfeh):Process stdin and psargs separately
[BK-2020-03.git] / user / check_ots.sh
CommitLineData
282cc59d
SBS
1#!/bin/bash
2
3yell() { echo "$0: $*" >&2; } # print script path and all args to stderr
4die() { yell "$*"; exit 111; } # same as yell() but non-zero exit status
5try() { "$@" || die "cannot $*"; } # runs args as command, reports args if command fails
6
7if [[ ! -f $1 ]]; then die "FATAL:Not a file:$1"; fi;
8
9ots u "$1" 1>/dev/null 2>&1;
10
11if ! ( ots v "$1" 1>/dev/null 2>/dev/null ); then
12 yell "ERROR:Verification failed:$1";
13 ots v "$1";
14fi;