* update fancontrol configuration * Enable network activity led, default to eth0 * Do not disable auto poweron on power loss event * Added UPS timer Provide timer to poweroff system after 600 s (10 minutes) of power loss event. If power restored within that time window, cancel the timer. * Use different service for legacy LK 4.4 does not have ledtrig-netdev, so it will cause the service to fail. * Use 10m instead 600 seconds in UPS timer Systemd time can use m suffix for minutes. Use this to make it easier to read.
22 lines
504 B
Bash
Executable File
22 lines
504 B
Bash
Executable File
#!/bin/bash
|
|
|
|
online=$(cat /sys/class/power_supply/gpio-charger/online)
|
|
[[ $online == 0 ]] && exit 0
|
|
|
|
# Export GPIO
|
|
# AUTO_ON_D
|
|
echo 153 > /sys/class/gpio/export
|
|
# AUTO_EN_CLK
|
|
echo 154 > /sys/class/gpio/export
|
|
|
|
echo out > /sys/class/gpio/gpio153/direction
|
|
echo out > /sys/class/gpio/gpio154/direction
|
|
|
|
# Toggling the D Flip-Flop
|
|
echo 0 > /sys/class/gpio/gpio153/value
|
|
echo 0 > /sys/class/gpio/gpio154/value
|
|
sleep 0.1
|
|
echo 1 > /sys/class/gpio/gpio154/value
|
|
sleep 0.1
|
|
echo 0 > /sys/class/gpio/gpio154/value
|