2 # logs the last line. usable via nohup on the server
4 # run this script as follows:
5 # $ nohup ./usb-wde1-log-last.sh &
7 # Use --dummy-data as parameter to log dummy data only
9 # License: http://www.gnu.org/licenses/agpl.html AGPL
10 # Author: Christian Weiske <cweiske@cweiske.de>
12 # FIXME: send RESET or INIT and M2
16 if [ ! -d /var/spool/usb-wde1 ]; then
17 mkdir /var/spool/usb-wde1
20 curdir="$(dirname "$0")"
21 if [ "$1" = "--dummy-data" ]; then
22 $curdir/../dummy-data-generator.php\
23 | $curdir/log-single-line.sh /var/spool/usb-wde1/usb-wde1-last
25 if [ ! -r $device ]; then
26 echo "Device $device is not readable"
30 #socat breaks something that leads to
31 # WRONG VAL, WRONG CMD and FullBuff->Reset
33 socat $device,b9600,min=1,time=1,brkint=0,icrnl=0,ixoff=1,imaxbel=0,opost=0,isig=0,icanon=0,iexten=0,echo=0,echoe=0,echok=0 STDOUT\
34 | $curdir/log-single-line.sh /var/spool/usb-wde1/usb-wde1-last