blob: 1bff18d0817e96205fe96c46a306cb1b731edc95 [file] [log] [blame]
George Hungb5eef512021-03-10 16:04:46 +08001#!/bin/bash
2
3state="xyz.openbmc_project.State.Chassis.PowerState.Off"
4
5dbus-monitor --system type='signal',interface='org.freedesktop.DBus.Properties',\
6member='PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Chassis' | \
7while read -r line; do
8 grep -q member <<< $line && continue
9 if grep -q $state <<< $line; then
10 echo "Setting failsafe assuming host is off" >&2
11 systemctl start --no-block gbs-host-s5-set-failsafe
12 fi
13done