Files
OpenBMC/meta-quanta/meta-gbs/recipes-google/acpi-power-state/acpi-power-state-daemon/gbs-check-host-state.sh
T
2026-04-23 17:07:55 +08:00

14 lines
455 B
Bash

#!/bin/bash
state="xyz.openbmc_project.State.Chassis.PowerState.Off"
dbus-monitor --system type='signal',interface='org.freedesktop.DBus.Properties',\
member='PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Chassis' | \
while read -r line; do
grep -q member <<< "$line" && continue
if grep -q $state <<< "$line"; then
echo "Setting failsafe assuming host is off" >&2
systemctl start --no-block gbs-host-s5-set-failsafe
fi
done