#!/bin/bash
# check NGCP type before running ngcp-upgrade
# it should prevent running PRO/Carrier ngcp-upgrade on CE by mistake

set -e

if dpkg-query -s ngcp-ngcp-pro >/dev/null 2>&1 ; then
  echo "ERROR: ngcp-upgrade community edition (CE) cannot be used for PRO/Carrier upgrades!" >&2
  echo "Exiting to avoid possible damage." >&2
  exit 1
fi

echo "All OK here."
exit 0
