Just updated my plug after quite a while


Figured this was a good time to lean systemsd via having the Pogo V2 leds do something....
The orange led lights up naturelment on boot, and remains, even after shutdown; I decided that instead I wanted the green led to signify network availability, and orange flashing on shutdown. I've ended up with this systemd service:
$this->bbcode_second_pass_code('', '
[Unit]
Description=LED control service
After=network.target
[Service]
Type=simple
RemainAfterExit=yes
ExecStartPre=/usr/bin/bash -c '/usr/bin/echo timer > /sys/class/leds/status\:green\:health/trigger'
ExecStartPre=/usr/bin/bash -c '/usr/bin/echo none > /sys/class/leds/status\:blue\:health/trigger'
ExecStart=/usr/bin/bash -c '/usr/bin/echo default-on > /sys/class/leds/status\:green\:health/trigger'
ExecStop=/usr/bin/bash -c '/usr/bin/echo timer > /sys/class/leds/status\:blue\:health/trigger'
ExecStopPost=/usr/bin/bash -c '/usr/bin/echo none > /sys/class/leds/status\:green\:health/trigger'
ExecStopPost=/usr/bin/bash -c '/usr/bin/echo none > /sys/class/leds/status\:blue\:health/trigger'
[Install]
WantedBy=multi-user.target
')
This simple service that remains after exit means that the pre-start and start tasks are run, but not the stop and post-stop. The stop tasks are run when the network target is stopped.
How it looks from boot is: orange, green flash, green - network is up!
From poweroff: orange flash, no-leds.
I'm not sure if I prefer no led when it's shutdown or a flashing orange led.
I hope this is useful to someone!