Skip to content

Commit b802413

Browse files
committed
sysinfo.json: add wg_vpn* traffic and show only tbb_wg single traffic
1 parent b882750 commit b802413

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

salt/freifunk/base/ddmesh/var/www_freifunk/sysinfo.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ echo ''
55

66
BMXD_DB_PATH='/var/lib/freifunk/bmxd'
77

8-
98
ddmesh_node="$(uci -qX get ffdd.sys.ddmesh_node)"
109
test -z "$ddmesh_node" && exit
1110

@@ -122,9 +121,12 @@ EOM
122121
echo " \"traffic_$iface_alias\": \"$(grep "$iface": /proc/net/dev | sed -n 's#.*:[ ]*\([0-9]\+\)\([ ]\+\([0-9]\+\)\)\{8\}.*#\1,\3#;p')\","
123122
fi
124123

125-
if [[ "$iface" =~ "tbb_wg"* ]]; then
126-
iface_alias="$iface"
127-
echo " \"traffic_$iface_alias\": \"$(grep "$iface": /proc/net/dev | sed -n 's#.*:[ ]*\([0-9]\+\)\([ ]\+\([0-9]\+\)\)\{8\}.*#\1,\3#;p')\","
124+
if [ "$iface" = "tbb_wg" ]; then
125+
echo " \"traffic_$iface\": \"$(grep "$iface": /proc/net/dev | sed -n 's#.*:[ ]*\([0-9]\+\)\([ ]\+\([0-9]\+\)\)\{8\}.*#\1,\3#;p')\","
126+
fi
127+
128+
if [[ "$iface" =~ "vpn"* ]]; then
129+
echo " \"traffic_wg_$iface\": \"$(grep "$iface": /proc/net/dev | sed -n 's#.*:[ ]*\([0-9]\+\)\([ ]\+\([0-9]\+\)\)\{8\}.*#\1,\3#;p')\","
128130
fi
129131
done
130132

0 commit comments

Comments
 (0)