#!/bin/sh set -eu if [ $# -lt 2 ]; then echo "Usage: $0 " >&2 exit 1 fi FLAVOR=$1 NEW_VERSION=$2 OLD_VERSION=${3:-} rc=0 if [ "$OLD_VERSION" ]; then if akms status -q -k "$OLD_VERSION-$FLAVOR" -s installed >/dev/null; then akms uninstall -k "$OLD_VERSION-$FLAVOR" all || rc=1 fi fi if [ "$NEW_VERSION" ]; then akms install -k "$NEW_VERSION-$FLAVOR" all || rc=1 fi exit $rc