nix-config/machines/storage/s0/helios64/modules/bsp/90-helios64-ups.rules
2022-03-01 18:08:17 -05:00

12 lines
424 B
Plaintext

ACTION=="add", GOTO="helios64_ups_end"
ACTION=="remove", GOTO="helios64_ups_end"
# Power loss event
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTRS{online}=="0", RUN+="/usr/bin/systemctl start helios64-ups.timer"
# Power restore event
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTRS{online}=="1", RUN+="/usr/bin/systemctl stop helios64-ups.timer"
LABEL="helios64_ups_end"