blob: bb9e482ae57a4ca3519ac8e6a5ad8b5f218ec231 [file] [log] [blame]
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -05001#!/bin/sh
2# set and unset occ active for all occ's in system
3
Patrick Williams42347492023-04-14 14:51:53 -05004if [ "$1" = "disable" ]; then
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -05005 value='false'
Patrick Williams42347492023-04-14 14:51:53 -05006elif [ "$1" = "enable" ]; then
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -05007 value='true'
8else
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"
Patrick Williams42347492023-04-14 14:51:53 -050012 exit 1
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050013fi
Andrew Geissler5c4e7da2017-08-21 15:56:41 -050014
15OCC_CONTROL_SERVICE="org.open_power.OCC.Control"
16
Alexander Filippov5c967162019-04-19 12:13:56 +030017busctl tree $OCC_CONTROL_SERVICE --list | grep -i occ | xargs -r -n1 -I{} \
Andrew Geissler5c4e7da2017-08-21 15:56:41 -050018 busctl set-property $OCC_CONTROL_SERVICE {} org.open_power.OCC.Status \
19 OccActive b $value
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050020exit 0