#! /usr/bin/env bash

GRAFANA_HOME="${GRAFANA_HOME:-/usr/share/grafana}"
EXECUTABLE="$GRAFANA_HOME/bin/grafana"

if [ ! -x "$EXECUTABLE" ]; then
  echo "$EXECUTABLE not installed or not executable"
  exit 5
fi

echo "Deprecation warning: 'grafana-cli' is deprecated and will be removed in a future release. Use the 'grafana cli' subcommand instead." >&2
exec "$EXECUTABLE" cli "$@"
