Skip to content

Commit

Permalink
sysinfo.json: add wg_vpn* traffic and show only tbb_wg single traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
cremesk committed Jan 5, 2024
1 parent b882750 commit b802413
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions salt/freifunk/base/ddmesh/var/www_freifunk/sysinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ echo ''

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


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

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

if [[ "$iface" =~ "tbb_wg"* ]]; then
iface_alias="$iface"
echo " \"traffic_$iface_alias\": \"$(grep "$iface": /proc/net/dev | sed -n 's#.*:[ ]*\([0-9]\+\)\([ ]\+\([0-9]\+\)\)\{8\}.*#\1,\3#;p')\","
if [ "$iface" = "tbb_wg" ]; then
echo " \"traffic_$iface\": \"$(grep "$iface": /proc/net/dev | sed -n 's#.*:[ ]*\([0-9]\+\)\([ ]\+\([0-9]\+\)\)\{8\}.*#\1,\3#;p')\","
fi

if [[ "$iface" =~ "vpn"* ]]; then
echo " \"traffic_wg_$iface\": \"$(grep "$iface": /proc/net/dev | sed -n 's#.*:[ ]*\([0-9]\+\)\([ ]\+\([0-9]\+\)\)\{8\}.*#\1,\3#;p')\","
fi
done

Expand Down

0 comments on commit b802413

Please sign in to comment.