diff --git a/files/usbserial-dw.config b/files/usbserial-dw.config new file mode 100644 index 0000000..34dcaea --- /dev/null +++ b/files/usbserial-dw.config @@ -0,0 +1,7 @@ +config usbserial + option port /dev/ttyUSB0 + option speed 115200 + option directory /tmp + option file camera.jpg + option webserver http://nuc.bh.ttx.sk/upload/ + option time 300 diff --git a/files/usbserial-dw.sh b/files/usbserial-dw.sh new file mode 100644 index 0000000..d6fd0b1 --- /dev/null +++ b/files/usbserial-dw.sh @@ -0,0 +1,26 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2018 wongsyrone + +. /lib/functions.sh + +PROG=/usr/bin/usbserial-dw + + +parse_capture() { + local section="$1" + local _port + local _speed + local _dir + local _file + + config_get _port "$section" "port" + config_get _speed "$section" "speed" + config_get _dir "$section" "dir" + config_get _file "$section" "file" + + $PROG --port $_port --speed $_speed --dir $_dir --file $_file + $CURL upload +} + +config_load usbserial +config_foreach parse_capture capture