#check environment if [ "x$SUDOCMD" == "x" \ -o "x$CATCMD" == "x" \ -o "x$GREPCMD" == "x" \ -o "x$USBDEVCMD" == "x" \ -o "x$RESETCMD" == "x" \ -o "x$AWKCMD" == "x" \ -o "x$TAILCMD" == "x" \ -o "x$FINDCMD" == "x" ]; then echo"some comand[s] was/were not found" exit 1 fi
if [ ! -f $LOGFILE ]; then echo"log file was not found" echo"log file is [${LOGFILE}]" exit 1 fi
#check usb address ret=`checkaddress` if [ "x$ret" == "x!" -o "x$ret" == "x" ]; then echo"usb device was not found" exit 1 fi
#watch checkfile ret=`watchcheckfile` if [ "x$ret" == "x!" -o "x$ret" == "x" ]; then exit 0 fi
#watch usbdevice reset ret=`watchreset` if [ "x$ret" == "x!" -o "x$ret" == "x" ]; then exit 0 fi
#reset usbdevice ret=`usbreset` if [ "x$ret" == "x!" -o "x$ret" == "x" ]; then ret=`usbreset` if [ "x$ret" == "x!" -o "x$ret" == "x" ]; then echo"FAIL!!!" exit 1 else touch$CHECKFILE exit 0 fi fi