From 2f7472869377ce2d84867dc839c3a9d00aa02dd5 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Fri, 7 Jun 2024 18:39:44 -0700 Subject: [PATCH] Add names to xlink routes and bridges. (#1239) Fix aredn_message_all file-not-found error. --- files/usr/local/bin/aredn_message.sh | 8 +++++--- files/www/cgi-bin/advancednetwork | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/files/usr/local/bin/aredn_message.sh b/files/usr/local/bin/aredn_message.sh index 42359392..9c043b52 100755 --- a/files/usr/local/bin/aredn_message.sh +++ b/files/usr/local/bin/aredn_message.sh @@ -73,9 +73,11 @@ then else # need to append to node file retrieve_alert http://downloads.arednmesh.org/messages/all.txt aredn_message_all "all nodes" - echo "
" >> /tmp/aredn_message - cat /tmp/aredn_message_all >> /tmp/aredn_message - rm /tmp/aredn_message_all + if [ -s "/tmp/aredn_message_all" ]; then + echo "
" >> /tmp/aredn_message + cat /tmp/aredn_message_all >> /tmp/aredn_message + rm /tmp/aredn_message_all + fi fi fi diff --git a/files/www/cgi-bin/advancednetwork b/files/www/cgi-bin/advancednetwork index eaaf35e3..15e7848f 100755 --- a/files/www/cgi-bin/advancednetwork +++ b/files/www/cgi-bin/advancednetwork @@ -309,7 +309,7 @@ function write_xlink_config(configs) f:write("# Generated by advancednetwork\n") for _, config in ipairs(configs) do - f:write("\nconfig bridge-vlan\n") + f:write("\nconfig bridge-vlan '" .. config.name .. "bridge'\n") f:write("\toption device 'br0'\n") f:write("\toption vlan '" .. config.vlan .. "'\n") f:write("\tlist ports '" .. config.port .. ":t'\n") @@ -332,7 +332,7 @@ function write_xlink_config(configs) end if config.peer and config.peer ~= "" then f:write("\toption peer '" .. config.peer .. "'\n") - f:write("\nconfig route\n") + f:write("\nconfig route '" .. config.name .. "route'\n") f:write("\toption interface '" .. config.name .. "'\n") f:write("\toption target '" .. config.peer .. "'\n") end