#!/bin/sh

APP_DIR="/usr/share/testme"
VENV="${APP_DIR}/venv"
APP="${APP_DIR}/testme.py"

if [ ! -f "$APP" ]; then
    echo "ERROR: HWDiag4 application not found:"
    echo "  $APP"
    exit 1
fi

if [ ! -x "${VENV}/bin/python" ]; then
    echo "ERROR: HWDiag4 Python environment is missing:"
    echo "  ${VENV}"
    echo
    echo "Try reinstalling the package."
    exit 1
fi

exec "${VENV}/bin/python" "$APP" "$@"
