1#!/bin/bash
2
3set -euo pipefail
4
5if [[ $# -ne 2 ]]; then
6    echo >&2 "Usage: $0 /path/to/binary file-output"
7    exit 1
8fi
9
10binary="$1"
11want_file_output="$2"
12
13out="$(file "${binary}")"
14
15if [[ "${out}" != *"${want_file_output}"* ]]; then
16    echo >&2 "Wrong file type: ${out}"
17    exit 1
18fi
19