op-packages/simman2/files/simman2.rpcd
github-actions[bot] b86d032e91 🤞 Sync 2026-04-23 06:19:46
2026-04-23 06:19:46 +08:00

32 lines
565 B
Bash

#!/bin/sh
. /usr/share/libubox/jshn.sh
case "$1" in
list)
echo '{'
echo '"info": { "device": "str", "cmd": "str" },'
echo '"statusall": { "config": "str" }'
echo '}'
;;
call)
case "$2" in
info)
# read the arguments
read input;
json_load "$input"
json_get_var device device
json_get_var cmd cmd
result=$(/sbin/simman2_cli -d $device $cmd)
echo "{ \"result\": \"$result\" }"
;;
statusall)
read input;
json_load "$input"
json_get_var config config
/sbin/simman2_cli -a $config
;;
esac
;;
esac