mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
peripheral_manager: ledctl with simplified API
This commit is contained in:
parent
be23fd6dc4
commit
8efd6f5207
1 changed files with 19 additions and 0 deletions
19
peripheral_manager/files/sbin/ledctl
Executable file
19
peripheral_manager/files/sbin/ledctl
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
usage () {
|
||||
echo "Usage: ledctl [normal|test|allon|alloff|production]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ $# -ne 1 ] && usage
|
||||
ledstate=$(echo $1 | tr '[A-Z]' '[a-z]')
|
||||
|
||||
case $ledstate in
|
||||
normal|test|allon|alloff|production)
|
||||
ubus call leds set "{\"state\" : \"$ledstate\"}"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
Loading…
Add table
Reference in a new issue