-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use RGB led colors to signal offline-update operations and final result
- Loading branch information
1 parent
4e2aa1b
commit 26f7e6b
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
recipes-support/arduino-ootb/arduino-ootb/offline-update.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |