The "sync-mongo" file can either contain a git commit id, or 0. When the file contains 0, the if statement still isn't entered.
COMMITID=`docker exec -it ${NAME} bash -c 'cd /usr/src/app/_api; cat sync-mongo.commit'`
if [ "${COMMITID}" == "0" ]
then
./_configuremongo.sh -i $INPUT -o $OUTPUT -r
fi
I've also tried:
if [ ${COMMITID} -eq 0 ]
then
./_configuremongo.sh -i $INPUT -o $OUTPUT -r
fi
which returns : integer expression expected[: 0