diff --git a/files/Makefile b/openwrt/Makefile similarity index 90% rename from files/Makefile rename to openwrt/Makefile index b061044..c02b88b 100644 --- a/files/Makefile +++ b/openwrt/Makefile @@ -14,7 +14,7 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.bh.ttx.sk/jaro/usbserial-dw.git PKG_MIRROR_HASH:= PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:= +PKG_SOURCE_VERSION:=6179fdee75ee3fcdb766aef5eb791c38e75ee33b PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION) @@ -63,11 +63,11 @@ define Package/usbserial-dw/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/usbserial-dw $(1)/usr/bin/usbserial-dw $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DATA) ./files/usbserial-dw.config $(1)/etc/config/ + $(INSTALL_DATA) ./files/usbserial-dw.config $(1)/etc/config/usbserial endef define Package/usbserial-dw/conffiles /etc/config/usbserial-dw endef -$(eval $(call BuildPackage,usbserial-dw)) \ No newline at end of file +$(eval $(call BuildPackage,usbserial-dw)) diff --git a/files/usbserial-dw.config b/openwrt/files/usbserial-dw.config similarity index 71% rename from files/usbserial-dw.config rename to openwrt/files/usbserial-dw.config index f4cde71..e6f3e57 100644 --- a/files/usbserial-dw.config +++ b/openwrt/files/usbserial-dw.config @@ -3,5 +3,5 @@ config capture option speed 115200 option directory /tmp option file camera.jpg - option webserver http://nuc.bh.ttx.sk/upload/ + option url https://meranie.bh.ttx.sk/upload/image option time 300 diff --git a/files/usbserial-dw.sh b/openwrt/files/usbserial-dw.sh similarity index 77% rename from files/usbserial-dw.sh rename to openwrt/files/usbserial-dw.sh index d6fd0b1..5a3dc3b 100644 --- a/files/usbserial-dw.sh +++ b/openwrt/files/usbserial-dw.sh @@ -4,7 +4,7 @@ . /lib/functions.sh PROG=/usr/bin/usbserial-dw - +CURL=/usr/bin/curl parse_capture() { local section="$1" @@ -17,9 +17,12 @@ parse_capture() { config_get _speed "$section" "speed" config_get _dir "$section" "dir" config_get _file "$section" "file" + config_get _url "$section" "url" $PROG --port $_port --speed $_speed --dir $_dir --file $_file - $CURL upload + cd $_dir + $CURL -v -X POST -F "submit=OK" -F "file=@camera.jpg" $_url + rm $_file } config_load usbserial