Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chirpstack/chirpstack-concentratord/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ define Package/chirpstack-concentratord/install

$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/gateway-id $(1)/usr/bin/
$(INSTALL_BIN) ./files/gateway-id.sh $(1)/usr/bin
endef

define Package/chirpstack-concentratord-2g4/install
Expand Down
31 changes: 31 additions & 0 deletions chirpstack/chirpstack-concentratord/files/gateway-id.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SLOTS="|slot1|slot2"
OUTPUT=""

oldIFS=$IFS
IFS="|"

for SLOT in $SLOTS; do

URL="/tmp/concentratord_command"
if [ "$SLOT" != "" ]; then
URL="/tmp/concentratord_${SLOT}_command"
fi

if [ -e "$URL" ]; then
GATEWAY_ID=$( /usr/bin/gateway-id -c "ipc://$URL" )
if [ $? -eq 0 ]; then
[ "$OUTPUT" != "" ] && OUTPUT="$OUTPUT / "
OUTPUT="${OUTPUT}${GATEWAY_ID}"
[ "$SLOT" != "" ] && OUTPUT="${OUTPUT} ($SLOT)"
fi
fi

done

IFS=$oldIFS

[ "$OUTPUT" = "" ] && OUTPUT="Could not read Gateway ID"

echo "$OUTPUT"
2 changes: 1 addition & 1 deletion theme/luci-theme-argon/luasrc/view/themes/argon/footer.htm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-%>

<%
local handle = io.popen("/usr/bin/gateway-id")
local handle = io.popen("sh /usr/bin/gateway-id.sh")
local gateway_id = handle:read("*a")
handle:close()
-%>
Expand Down