#!/bin/sh set -e cd `dirname $0` BRANCH= MODEL=omnia while [ $# -gt 0 ]; do case "$1" in -h|--help) echo "This script generates Turris medkit using user lists and updater-ng." echo "Usage: $0 [OPTION]..." echo echo "Options:" echo " --help, -h" echo " --version VERSION" echo " --branch BRANCH" echo " --model MODEL" exit 0 ;; --version) shift VERSION="$1" ;; --branch) shift BRANCH="$1" ;; --model) shift MODEL="$1" ;; *) echo "Unknown option: $1" >&2 exit 1 ;; esac shift done # Get latest version if we didn't stated version explicitly if [ -z "$VERSION" ]; then [ -n "$BRANCH" ] && VBRANCH="-$BRANCH" VERSION="$(curl https://repo.turris.cz/omnia-dev-karel/packages/base/Packages | sed -n 's/^Filename: turris-version_\([^_]*\)_.*/\1/p')" fi # Ensure that we have tools ./scripts/build_tools.sh # Download api crl chmod +x .get-api-crl ./.get-api-crl # Now build medkit fakeroot ./scripts/updater-medkit.sh --version "$VERSION" --branch "$BRANCH" --model "$MODEL"