#!/bin/sh

# Set default values
APPDIR=${APPDIR:-..}
VERBOSE=${VERBOSE:-0}

. ${APPDIR}/common.subr

sect "BIOS information"

if check_privs /dev/mem; then
	# Check whether dmidecode tool is available
	if which -s dmidecode; then
		dmidecode -t bios | sed -En 's/^[[:space:]]+//; /Vendor|Version|Revision|Release/p'

		if is_verbose 1; then
			echo
			dmidecode -t bios | sed -En 's/^[[:space:]]+//; /Address|Runtime|ROM/p'
		fi

		echo

		info "Run \`dmidecode -t bios\` to see further information."
	else
		# Advice user to install it
		warn "You will need to install the sysutils/dmidecode port in order to obtain this information."
	fi
fi

exit 0
