Skip to content

Commit

Permalink
Add new reference state data types to shared state
Browse files Browse the repository at this point in the history
  • Loading branch information
javierajorge committed Aug 25, 2023
1 parent 46e52ca commit 4e89059
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/shared-state-reference-state/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Copyright (C) 2019 Gioacchino Mazzurco <gio@altermundi.net>
# Copyright (C) 2023 Javier Jorge <jjorge@inti.gob.ar>
#
# This is free software, licensed under the GNU Affero General Public License v3.
#

include $(TOPDIR)/rules.mk

GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . )
GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . )

PKG_NAME:=shared-state-wifi_links_info
PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP)

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)
TITLE:=Reference state datatypes module for shared-state
CATEGORY:=LibreMesh
URL:=http://libremesh.org
DEPENDS:= shared-state
PKGARCH:=all
endef

define Package/$(PKG_NAME)/description
Syncronize Reference state datatypes using shared state multiwriter.
endef

define Build/Compile
endef

define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/
$(CP) ./files/* $(1)/
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

unique_append()
{
grep -qF "$1" "$2" || echo "$1" >> "$2"
}

unique_append \
'*/5 * * * * ((sleep $(($RANDOM % 120)); shared-state-multiwriter sync reference_state_nodes_info &> /dev/null)&)'\
/etc/crontabs/root
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

unique_append()
{
grep -qF "$1" "$2" || echo "$1" >> "$2"
}

unique_append \
'*/5 * * * * ((sleep $(($RANDOM % 120)); shared-state-multiwriter sync reference_state_wifi_links_info &> /dev/null)&)'\
/etc/crontabs/root

0 comments on commit 4e89059

Please sign in to comment.