Files
swupd-server/publish.sh
T
Patrick McCarty 26892177e6 Align variable default values in builder scripts
Also, make some of the variables overridable in the environment.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-03-02 08:09:07 -08:00

22 lines
818 B
Bash
Executable File

#!/bin/bash
# Update content is created and output into the www directory, but the
# published "latest" version number is only bumped in
# www/version/formatstaging/latest. This enables QA on devices whose update
# client is set to query the www/version/formatstaging/latest. Once that
# QA is complete, this publish script is run to bump the production
# format's "latest" version number.
if [[ $# < 1 ]]; then
echo "First argument must be a format number"
echo "$0 aborting"
exit 1
fi
FORMAT=$1
UPDATEDIR=${UPDATEDIR:-"/var/lib/update"}
ver1=`cat ${UPDATEDIR}/www/version/formatstaging/latest`
ver2=`cat ${UPDATEDIR}/www/version/format$FORMAT/latest`
cp ${UPDATEDIR}/www/version/formatstaging/latest ${UPDATEDIR}/www/version/format$FORMAT/latest
echo "Updated from $ver2 to $ver1 in format $FORMAT"