#!/bin/sh
if [ x"$1" = x ] ; then
  PKG="$(ls -1 capacisense2*.tgz 2>/dev/null | sort | tail -1)"
elif [ -d "$1" ] ; then
  PKG="$(ls -1 "$1"/capacisense2*.tgz 2>/dev/null | sort | tail -1)"
else
  PKG="$(echo "$1" | fgrep capacisense2)"
fi
PATH="/sbin:/usr/sbin:$PATH"
[ x"$PKG" != x ] && upgradepkg "$PKG"
