#!/bin/bash USAGE="" # shellcheck source=resteasy-helper.sh source "$(resteasy --exec-path)/resteasy-helper.sh" set -o errexit set -o nounset [[ "$#" -eq 0 ]] || die_with_usage "too many arguments" mapfile -t uuids < <(lsblk \ --noheadings \ --list \ --output PARTTYPE,PARTUUID \ | grep "$RESTEASY_TYPE_UUID" \ | cut -d' ' -f 2) [[ ${#uuids[@]} -gt 0 ]] || die "no resteasy device found" [[ ${#uuids[@]} -lt 2 ]] || die "more than one resteasy devices found; this command only supports one device plugged in at a time" echo "${uuids[0]}"