blob: 97f9cfe57a63aedf429e6923fe32b43245c0370a [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
Patrick Williams8c226232023-04-15 20:05:21 -05008 grep -q member <<< "$line" && continue
9 if grep -q $state <<< "$line"; then
George Hungb5eef512021-03-10 16:04:46 +080010 echo "Setting failsafe assuming host is off" >&2
11 systemctl start --no-block gbs-host-s5-set-failsafe
12 fi
13done