All pastes #539868 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-05 11:52 UTC
rendered paste body
adam@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
###