#!/bin/bash

if [ -f /usr/bin/ParseDico ];then
    #EOLE 2.3
    RunCmd=RunCmd
    . ParseDico
    . /etc/eole/containers.conf
    . /usr/share/eole/FonctionsEoleNg

else
    #EOLE 2.4
    RunCmd=CreoleRun
    container_path_web=$(CreoleGet container_path_web)
    activer_ethercalc=$(CreoleGet activer_ethercalc non)
fi

calc_dump="/usr/share/eole/nodejs/ethercalc/dump.json"
if [ "$activer_ethercalc" = "oui" ]; then
    if [ -f "${container_path_web}${calc_dump}" ]; then
        /bin/chgrp -f www-data ${container_path_web}${calc_dump}
        /bin/chmod -f g+w ${container_path_web}${calc_dump}
    fi
fi
