Skip to content

Commit

Permalink
Use RGB led colors to signal offline-update operations and final result
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxPayne86 committed Dec 3, 2024
1 parent 4e2aa1b commit 26f7e6b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[Unit]
Description=Start offline update
ConditionPathExists=/var/sota/offline-updates
Conflicts=connection-status-led.timer connection-status-led.service m4-led-forwarder.service

[Service]
Type=oneshot
SuccessExitStatus=0 100 101
ExecStart=/usr/bin/aklite-offline install --log-level=0 --src-dir /var/sota/offline-updates/
ExecStartPre=/bin/sh -c 'echo heartbeat > /sys/class/leds/ledG/trigger; echo none > /sys/class/leds/ledR/trigger'
ExecStart=/bin/sh -c '/usr/bin/aklite-offline install --log-level=0 --src-dir /var/sota/offline-updates/; RET=$?; if [ $RET -eq 0 ] || [ $RET -eq 100 ] || [ $RET -eq 101 ]; then touch /var/run/offline-update-success; else rm -f /var/run/offline-update-success; fi'
ExecStartPost=/bin/sh -c 'if [ -f /var/run/offline-update-success ]; then echo default-on > /sys/class/leds/ledG/trigger; echo none > /sys/class/leds/ledR/trigger; else echo none > /sys/class/leds/ledG/trigger; echo default-on > /sys/class/leds/ledR/trigger; fi'
ExecStartPost=/bin/sh -c 'touch /var/sota/offline-update-pending; shutdown -r 1'

0 comments on commit 26f7e6b

Please sign in to comment.