#!/usr/bin/bash
if ping -c 1 redos.red-soft.ru &> /dev/null
then
  if ping -c 1 repo1.red-soft.ru &> /dev/null
  then 
  if curl -s https://redos.red-soft.ru/product/repositoriy2/API/export/ &> /dev/null
    then
      PYTHONASYNCIODEBUG=1 PYTHONFAULTHANDLER=1 /usr/bin/python3 /opt/redos_education/store/__init__.py $*
    else
      PYTHONASYNCIODEBUG=1 PYTHONFAULTHANDLER=1 /usr/bin/python3 /opt/redos_education/dnfproxy/__init__.py
  fi
  else
    PYTHONASYNCIODEBUG=1 PYTHONFAULTHANDLER=1 /usr/bin/python3 /opt/redos_education/dnfproxy/__init__.py
  fi    
else
  PYTHONASYNCIODEBUG=1 PYTHONFAULTHANDLER=1 /usr/bin/python3 /opt/redos_education/dnfproxy/__init__.py
fi
