The autorun mode - TheKikGen/MPC-LiveXplore GitHub Wiki
When the MPC binay detects an "autorun.json", it will launch the script configured in the "script" tag with a sh system command.
autorun.json
{
"value0": {
"files": [],
"scripts": [
{
"askQuestion": true,
"path": "install-content.sh",
"message": "Install content? This will only install on an MPC One.",
"noButtonText": "no",
"yesButtonText": "yes"
}
]
}
}
An "autorun.check" file is here for script integrity. If you modify the script, it will not run because of that check.
da90f08f7d7820f0ad4797e132de9eeec78af1404fe2eac36a121a7ebe4304da
It looks like a SHA256 key.
The corresponding shell script is the following :
#!/bin/sh
set -eux
if [ ! -x /usr/bin/MPC ]
then
echo "Looks like this is not an MPC - exiting"
exit 1
fi
ACVA_VIDPID="09e8:0046"
if [ "`lsusb | grep $ACVA_VIDPID | cut -d ' ' -f 6`" != "$ACVA_VIDPID" ]
then
echo "Looks like this is not an MPC One - exiting"
exit 1
fi
systemctl stop inmusic-mpc
function startmpc {
systemctl start inmusic-mpc
}
trap startmpc EXIT
AUTORUN_DIR=`dirname "$0"`
CONTENT_DIR=/media/acvs-content/Expansions
rm -rf $CONTENT_DIR/*
gunzip --stdout "$AUTORUN_DIR/content/acva-content.tar.gz" | tar -xvf - -C $CONTENT_DIR