Untitled
public text v1 · immutableadam@debian:~$ cat usbkey.sh
HALDEVICE="/usr/bin/hal-device"
SERIAL="USB_Flash_Disk"
SLEEPTIME=3
###
while (true); do
$HALDEVICE |grep storage|grep ${SERIAL} >/dev/null
RET=$?
if [ ${RET} -eq 0 ]; then
echo "Device connected";
else
echo "Device not connected";
fi
sleep $SLEEPTIME
done
###