#!/bin/sh

DEST="/etc/dscribe/dscribe-upload.yaml"

if [ -e /etc/yandex/environment.type ]; then
    YANDEX_ENV=$(cat /etc/yandex/environment.type)
fi

if [ "$YANDEX_ENV" = "" ]; then
    YANDEX_ENV="development"
fi

case "$YANDEX_ENV" in
    production|prestable)
        SOURCE="/etc/dscribe/dscribe-upload-files.yaml"
        ;;

    *)
        SOURCE="/etc/dscribe/dscribe-upload-files-np.yaml"
        ;;
esac

if [ -e $SOURCE ]; then
    ln -s -f -T $SOURCE $DEST || true
fi

