shell script for detection