#!/bin/sh

if [ "$appHome" = "" ]; then
  appHome="/opt/webservice"
fi
if [ "$varPath" = "" ]; then
  varPath="/var/opt/webservice"
fi

PLT_QUERY_FILE=/usr/sbin/system-is-dscxl2

if [ -f ${PLT_QUERY_FILE} ]; then

  # it seems os4k-platform-support is installed, so we have a platform version > 7.1.x
  ${PLT_QUERY_FILE}
  rc=$?
  if [ "$rc" = "0" ]; then
    echo "Hardware is a DSCXL"
    exit 1
  else
    echo "Hardware is not a DSCXL"
    exit 0
  fi
else
  # it seems os4k-platform-support is not installed, so we have a platform version <=  7.1.7
  # in this case we make the traditional query via lsusb
  
  /usr/bin/lsusb -d 045b:2014 > /dev/null 
  if [ "$?" = "0" ]; then
    echo "Hardware is a DSCXL"
    exit 1
  else
    echo "Hardware is not a DSCXL"
    exit 0
  fi
fi
