From 282cc59d9c67c0882fd3ab9e8e2476b341a862dd Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Thu, 21 Jul 2022 04:55:39 +0000 Subject: [PATCH 1/1] feat(user/):Add script to check an ots file new file: user/check_ots.sh --- user/check_ots.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 user/check_ots.sh diff --git a/user/check_ots.sh b/user/check_ots.sh new file mode 100644 index 0000000..586e13e --- /dev/null +++ b/user/check_ots.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +yell() { echo "$0: $*" >&2; } # print script path and all args to stderr +die() { yell "$*"; exit 111; } # same as yell() but non-zero exit status +try() { "$@" || die "cannot $*"; } # runs args as command, reports args if command fails + +if [[ ! -f $1 ]]; then die "FATAL:Not a file:$1"; fi; + +ots u "$1" 1>/dev/null 2>&1; + +if ! ( ots v "$1" 1>/dev/null 2>/dev/null ); then + yell "ERROR:Verification failed:$1"; + ots v "$1"; +fi; -- 2.30.2