#!/bin/sh

if [ $# -ne 1 ]
then
  echo "sd-status: usage: module" 1>&2
  exit 1
fi

#
# Load essential subs.
#

. ./sysdep-subs "$1" || exit 1

#
# Load essential subroutines (not passed through shell executions).
#

. ./sysdep-boot "$1" || exit 1

#
# Check status.
#

STATUS_FILE="${SYSDEP_STATUS_DIRECTORY}/${SYSDEP_MODULE}"

if [ -f "${STATUS_FILE}" ]
then
  ${SYSDEP_UTIL_CAT} "${STATUS_FILE}" || SYSDEP_FATAL "could not read ${STATUS_FILE}"
else
  ${SYSDEP_UTIL_ECHO} "not-executed"
fi
