Skip to content

Commit

Permalink
luci-app-falter-owm: reimplement owm.lua in sh
Browse files Browse the repository at this point in the history
As OpenWrt will stop its use of lua in the next time, we decided
to reimplement the owm.lua script, which pushes node data to the
openwifimap api. This script implements some kind of owm-api v1.0.

It's a basis for the new owm-api-script, which we can write, after
we found a definition for the new format.

Signed-off-by: Martin Hübner <[email protected]>
  • Loading branch information
akira25 committed Jun 30, 2021
1 parent 3da4c30 commit 8225488
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 220 deletions.
2 changes: 1 addition & 1 deletion luci/luci-app-falter-owm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ endef

define Package/luci-app-falter-owm-cmd/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(CP) files/owm.lua $(1)/usr/sbin/owm.lua
$(CP) files/owm.sh $(1)/usr/sbin/owm.sh
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(CP) files/owm-defaults $(1)/etc/uci-defaults/owm
endef
Expand Down
2 changes: 1 addition & 1 deletion luci/luci-app-falter-owm/files/owm-defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
test -f /etc/crontabs/root || touch /etc/crontabs/root
SEED="$( dd if=/dev/urandom bs=2 count=1 2>&- | hexdump | if read line; then echo 0x${line#* }; fi )"
MIN="$(( $SEED % 59 ))"
crontab -l | grep -q "owm.lua" || crontab -l | { cat; echo "$MIN * * * * test -e /usr/sbin/owm.lua && /usr/sbin/owm.lua"; } | crontab -
crontab -l | grep -q "owm.sh" || crontab -l | { cat; echo "$MIN * * * * test -e /usr/sbin/owm.sh && /usr/sbin/owm.sh"; } | crontab -
118 changes: 0 additions & 118 deletions luci/luci-app-falter-owm/files/owm.lua

This file was deleted.

Loading

0 comments on commit 8225488

Please sign in to comment.