mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-08-01 15:09:33 +08:00
32 lines
565 B
Bash
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
|