I want to run a script that installs a Mender Artifact automatically with “mender -install” and reboots the host if required. With this script, I will install a mix of rootfs updates and update modules (which do not require a reboot) and I would like the script to reboot the host only when required by the artifact that was installed (specifically, by the particular module that handles this artifact).
It looks like I would need to grep the output of “mender -install” for the word “reboot” (which kinda sucks). Or, fork the mender client and add a command that returns whether a given artifact requires a reboot (based on the module’s response to NeedsArtifactReboot). Is there any other way? fw_printenv possibly?