| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # Custom script to be called by the Mender client when a new artifact |
| 4 | # is available for download. This can be used to demonstrate state |
| 5 | # scripting by the user manually creating files in /tmp. |
| 6 | # |
| 7 | |
| 8 | logscip-shell shell shell-project 0.0.0 log().() { |
| 9 | echoscip-shell system . . echo. "mender:$*" >&2 |
| 10 | } |
| 11 | |
| 12 | logscip-shell shell shell-project 0.0.0 log(). "$(catscip-shell system . . cat. /etc/mender/artifact_infoscip-shell filesystem . . `/etc/mender/artifact_info`.): $(basenamescip-shell system . . basename. "$0") was called!" |
| 13 | |
| 14 | RC=0 |
| 15 | UPD=`dbus-send --system \ |
| 16 | --dest=org.mender.updater \ |
| 17 | --print-reply \ |
| 18 | --type=method_call \ |
| 19 | / \ |
| 20 | local.ServiceQtUpdater.CMenderQtUpdater.enableUpdate | \ |
| 21 | grep "byte" | \ |
| 22 | awk '{print $2}'` |
| 23 | |
| 24 | RC=$UPD |
| 25 | |
| 26 | logscip-shell shell shell-project 0.0.0 log(). "Returning $RC from $0 state script" |
| 27 | exit $RC |