mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
- Fix all errors catched by cppcheck threadsafety (cppcheck --error-exitcode=0 --addon=threadsafety bbf) - Fix some errors catched by cppcheck cert (cppcheck --error-exitcode=0 --addon=cert bbf) - Add new str-protected macros instead of using str functions directly to avoid crashes
30 lines
1.1 KiB
Bash
Executable file
30 lines
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
. /usr/share/libubox/jshn.sh
|
|
|
|
case "$1" in
|
|
list)
|
|
echo '{ "rmonstats" : {"ifname":"str"} }'
|
|
;;
|
|
call)
|
|
case "$2" in
|
|
rmonstats)
|
|
read input;
|
|
json_load "$input"
|
|
json_get_var ifname ifname
|
|
if [ "$ifname" = "eth1" ]; then
|
|
cat /tmp/rmonstats_eth1.data 2>/dev/null
|
|
elif [ "$ifname" = "eth2" ]; then
|
|
cat /tmp/rmonstats_eth2.data 2>/dev/null
|
|
elif [ "$ifname" = "eth3" ]; then
|
|
cat /tmp/rmonstats_eth3.data 2>/dev/null
|
|
elif [ "$ifname" = "eth4" ]; then
|
|
cat /tmp/rmonstats_eth4.data 2>/dev/null
|
|
else
|
|
cat /tmp/rmonstats_eth0.data 2>/dev/null
|
|
fi
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
|