#! /bin/bash
# WB 20051212
# Skript /etc/hotplug/skript/visor
# 20110901: /etc/udev/skripte/visor
# wird aufgerufen, wenn ein USB visor Gerät ein- oder ausgesteckt wird. 
# zumindes beim laden vom visor modul
# Also der Palm
# start über RUN aus udev local.rules

date >>/tmp/visor.log
#set >>/tmp/visor.log
echo $DEVNAME >>/tmp/visor.log
ls -l /dev/palm /dev/pilot >>/tmp/visor.log

beep -l 10 -f 250 -n beep -l 10 -f 500

#automatischer Hotsync
if [ -e /home/wolfgang/.jpilot/AutoHotsync ]; 
then
		export PILOTRATE=H230400
		date >>/tmp/jpilot-sync.log
		killall /usr/bin/jpilot-sync &>>/tmp/jpilot-sync.log
		ls -l /dev/palm /dev/pilot &>>/tmp/jpilot-sync.log
		( sleep 3 ; sudo -H -u wolfgang /usr/bin/jpilot-sync >>/tmp/jpilot-sync.log 2>&1 )&
fi
