#!/bin/bash

set -euEo pipefail

if [[ -f "${UPGRADE_DIR}/general_license_proxy" ]]; then
  echo "File ${UPGRADE_DIR}/general_license_proxy detected"
  echo "setting general.license_proxy to $(cat "${UPGRADE_DIR}/general_license_proxy")"
  ngcpcfg set /etc/ngcp-config/config.yml general.license_proxy="$(cat "${UPGRADE_DIR}/general_license_proxy")"
else
  echo "No file ${UPGRADE_DIR}/general_license_proxy"
  echo "Nothing to do, exiting"
fi
