Chris Cain | 7bd6d14 | 2023-01-11 13:41:09 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # set and unset occ active for all occ's in system |
| 3 | |
| 4 | if [ "$1" = "disable" ]; then |
| 5 | value='false' |
| 6 | elif [ "$1" = "enable" ]; then |
| 7 | value='true' |
| 8 | else |
| 9 | echo "Usage: occ-active.sh [argument]" |
| 10 | echo " enable - set occ's to active state" |
| 11 | echo " disable - set occ's to inactive state" |
| 12 | exit 255 |
| 13 | fi |
| 14 | |
| 15 | OCC_CONTROL_SERVICE="org.open_power.OCC.Control" |
| 16 | |
| 17 | busctl tree $OCC_CONTROL_SERVICE --list | grep -i occ | xargs -r -n1 -I{} \ |
| 18 | busctl set-property $OCC_CONTROL_SERVICE {} org.open_power.OCC.Status \ |
| 19 | OccActive b $value |
| 20 | exit 0 |