George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | state="xyz.openbmc_project.State.Chassis.PowerState.Off" |
| 4 | |
| 5 | dbus-monitor --system type='signal',interface='org.freedesktop.DBus.Properties',\ |
| 6 | member='PropertiesChanged',arg0namespace='xyz.openbmc_project.State.Chassis' | \ |
| 7 | while 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 |
| 13 | done |