From 1fd909b18de5bf1e3d23b459ea8652d4ba8303a0 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Wed, 3 Nov 2021 19:26:56 -0700 Subject: [PATCH] Meshoween: Better way to add new uci meshstatus section (#159) --- CONTRIBUTORS | 1 + files/etc/uci-defaults/97_aredn_setup_meshstatus | 5 +++++ files/www/cgi-bin/mesh | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 files/etc/uci-defaults/97_aredn_setup_meshstatus diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6cdef24f..b6df0349 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -8,3 +8,4 @@ Jason Brady - KF5DEB Eric Satterlee - KG6WXC Ray Suelzer - KK6RAY Steve Lewis - AB7PA +Tim Wilkinson - KN6PLV diff --git a/files/etc/uci-defaults/97_aredn_setup_meshstatus b/files/etc/uci-defaults/97_aredn_setup_meshstatus new file mode 100644 index 00000000..a337ceb7 --- /dev/null +++ b/files/etc/uci-defaults/97_aredn_setup_meshstatus @@ -0,0 +1,5 @@ +#! /bin/sh +if [ "$(/sbin/uci -q get aredn.\@meshstatus[0])" = "" ]; then + /sbin/uci -q add aredn meshstatus + /sbin/uci -q commit aredn +fi diff --git a/files/www/cgi-bin/mesh b/files/www/cgi-bin/mesh index a139d651..23d41fe5 100755 --- a/files/www/cgi-bin/mesh +++ b/files/www/cgi-bin/mesh @@ -84,10 +84,6 @@ use perlfunc; ); # Limit displayed nodes and services to the most reachable routes if memory on the node is small -if ( `/sbin/uci -q get aredn.\@meshstatus[0]` eq "" ) -{ - system "(/sbin/uci -q add aredn meshstatus; /sbin/uci -q commit aredn) > /dev/null"; -} %lowMemoryLimits = ( memory => `/sbin/uci -q get aredn.\@meshstatus[0].lowmem` || 10000, routes => `/sbin/uci -q get aredn.\@meshstatus[0].lowroutes` || 1000,