#!/bin/sh

export PATH=$PATH:/var/www/alko-garden.de/.nvm/versions/node/v12.15.0/bin

mysql -u alkousr --password="shie4aekie#ghei(thieFaec9k" prod_alko_db -h 10.0.0.1 -A -e "select OXID from oxarticles where oxsparepart = 0 and ((oxshopid=3 and OXTITLE_2='') or (oxshopid=4 and OXTITLE_3='') or (oxshopid=5 and OXTITLE_4='') or (oxshopid=6 and OXTITLE_5='') or (oxshopid=8 and OXTITLE_7='') );" > /var/www/alko-garden.de/logs/missingNames.txt
mysql -u alkousr --password="shie4aekie#ghei(thieFaec9k" prod_alko_db -h 10.0.0.1 -A -e "select o.OXID from oxarticles as o LEFT JOIN oxarticles_set1 as os on os.OXID=o.OXID where o.oxsparepart = 0 and ((o.oxshopid=9 and os.OXTITLE_8='') or (o.oxshopid=10 and os.OXTITLE_9='') or (o.oxshopid=12 and os.OXTITLE_11=''));" >> /var/www/alko-garden.de/logs/missingNames.txt


cd /var/www/alko-garden.de/modules/alko/pim/Service

NODE_ENV=production node src/index.js SyncProductsNames pl
NODE_ENV=production node src/index.js SyncProductsNames sv
NODE_ENV=production node src/index.js SyncProductsNames nb
NODE_ENV=production node src/index.js SyncProductsNames da_DK
NODE_ENV=production node src/index.js SyncProductsNames hu
NODE_ENV=production node src/index.js SyncProductsNames cs
NODE_ENV=production node src/index.js SyncProductsNames sk
NODE_ENV=production node src/index.js SyncProductsNames fr
