Well, I would try this:
- Open a shell (bash, sh, ksh) and type:
set -e
(enables errorhandling)
- Insert Your BT- device
- Type:
echo $?
You should get a number larger than 0, which is an errorcode. Depending on which shell you use, there might be set some environment variables:
- ERR=$?=Errorcode
- ERL=Linenumber if trap was detected in a script.
- $?=0 then there is no errorcode, and U dont need to read further.
Write a script, or test by hand:
trap 'ERR=$?;errorhandler' listofcodes
errorhandler is the script that decides what todo when any of the listofcodes occur.
The list could be 1 10 14 15 (17 18 ...) or just 1 number, the one you want to catch.
# script errorhandler
errorhandler(){
case $ERR in
1)
# here U can take action or perhaps just ignore
return
;;
*)
# action if errorcode was different from 1
;;
esac
}
You would place line 1-4 in /etc/profile
or similar to make it systemwide.
In /etc
there should be an rc.d
or init.d
containg start and stop scripts related to boot and change in runstate. There should be a scriptfile for your BT device, check it out, but don't change content unless ...
If the errorcode in line 2 is zero then you must dig deeper.
ps -p 1 -o comm=
– Nov 11 '16 at 19:09