#!/bin/bash

HAS_SUGGESTIONS=`cat /opt/pos/etc/config.ini | grep PRODUCTS_SUGESTION\= | cut -f2 -d=`
PRODUCTS_SUGESTION_DONT_LEARN=`cat /opt/pos/etc/config.ini | grep PRODUCTS_SUGESTION_DONT_LEARN\= | cut -f2 -d=`

if [ "$PRODUCTS_SUGESTION_DONT_LEARN" = "" ]; then
  PRODUCTS_SUGESTION_DONT_LEARN="0"
fi

if [ "$HAS_SUGGESTIONS" = "1" ] && [ "$PRODUCTS_SUGESTION_DONT_LEARN" = "0" ]; then
  /opt/pos/server/apps/suggestions_generate.pl
fi

