#!/bin/sh

# Проверяет является ли текущий сервер сервером, поддерживающий регистратор (registry.local) и сервер подписи образов (sigstore.local)
isSigstoreServer() {
  if line="$(grep 'registry.local\|sigstore.local' /etc/hosts)"
  then
    set -- $line
    export ip=$1
    if ! ip a | grep $ip >/dev/null 2>&1
    then
      echo "$(gettext 'Domains registry.local sigstore.local in the file /etc/hosts are bound to a remote server with ip') $ip" >&2
    fi
  else
    echo $(gettext 'Domains registry.local sigstore.local are not specified in the /etc/hosts file.')  >&2
    echo "$(gettext 'Run the podsec-create-policy script')."  >&2
  fi
}


