OS: move service scripts into libexec
This commit is contained in:
27
buildroot-external/rootfs-overlay/usr/libexec/hassos-rate
Executable file
27
buildroot-external/rootfs-overlay/usr/libexec/hassos-rate
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
|
||||
function mark_good() {
|
||||
rauc status mark-good
|
||||
exit 0
|
||||
}
|
||||
|
||||
function mark_bad() {
|
||||
rauc status mark-bad
|
||||
systemctl reboot
|
||||
}
|
||||
|
||||
#### Check system ####
|
||||
|
||||
# Docker state
|
||||
if systemctl -q is-failed docker; then
|
||||
mark_bad
|
||||
fi
|
||||
|
||||
# Docker state
|
||||
if systemctl -q is-failed hassos-supervisor; then
|
||||
mark_bad
|
||||
fi
|
||||
|
||||
mark_good
|
||||
Reference in New Issue
Block a user