#!/bin/bash

set -e

DATASOURCES_FILE=/etc/yandex/tools-datasources/datasources.py

if [ -f $DATASOURCES_FILE ]; then
    chmod a+rx /etc/yandex /etc/yandex/tools-datasources/
    chmod a+r $DATASOURCES_FILE
fi

if [ -z "$1" ]; then
    exec supervisord -c /procu/conf/supervisord.conf
else
    exec $@
fi
