#!/bin/bash
. /home/ROULETTE/common.config #here is configuration of ROULETTE and FC5 locations


#tale check ne dela ce zaganjamo iz wget - bin bash...
#if another instance of this scrpt is already running, exit
#for pid in $(pidof -x $0); do
#    if [ $pid != $$ ]; then
#        echo "[$(date)] : $0 : Process is already running with PID $pid"
#        exit 1
#    fi
#done


#set costumization
echo "select RESULT from SET_PARAM('GLOBAL', 'UPDATE_ALL.sh', 'JURISDICTION', '', '', 11, NULL, 'DEFAULT');"|/home/ROULETTE/sqlexec.sh
echo "select RESULT from SET_PARAM('GLOBAL', 'UPDATE_ALL.sh', 'BILL_CURRENCY', '', '', 11, NULL, 'INR');"|/home/ROULETTE/sqlexec.sh
echo "select RESULT from SET_PARAM('GLOBAL', 'UPDATE_ALL.sh', 'ACCOUNTING_CURRENCY', '', '', 11, NULL, 'INR');"|/home/ROULETTE/sqlexec.sh
echo "select RESULT from SET_PARAM('PLATFORM', 'UPDATE_ALL.sh', 'GAMES_ORDER', '', '', 11, NULL, '4');"|/home/ROULETTE/sqlexec.sh
echo "select RESULT from SET_PARAM('GLOBAL', 'UPDATE_ALL.sh', 'MACHINE_TIMEZONE', '', '', 11, NULL, 'Asia/Katmandu');"|/home/ROULETTE/sqlexec.sh

echo "select RESULT from SET_PARAM('GLOBAL', 'UPDATE_ALL.sh', 'DEF_LANGUAGE', '', '', 11, NULL, '11');"|/home/ROULETTE/sqlexec.sh
echo "select RESULT from SET_PARAM('GLOBAL', 'UPDATE_ALL.sh', 'MENU_LANGUAGE', '', '', 11, NULL, '11');"|/home/ROULETTE/sqlexec.sh
#echo "select RESULT from SET_PARAM('GLOBAL', 'UPDATE_ALL.sh', 'LOCALE', '', '', 11, NULL, 'en_us');"|/home/ROULETTE/sqlexec.sh
#echo "delete FROM CONFIGURATION WHERE ATTR_NAME like 'KEY\_%' ESCAPE '\';"|/home/ROULETTE/sqlexec.sh


#SINGLE or DOUBLE ZERO for roulette games
echo "select result from SET_PARAM('GLOBAL', 'UPDATE', 'IS_DOUBLE_ZERO', '', '', 11, 0, '0');"|/home/ROULETTE/sqlexec.sh
echo "select result from SET_PARAM('WHEEL_1', 'UPDATE', 'ZERO_NUMBER_OFFSET', '', '', 11, 36, '36');" | /home/ROULETTE/sqlexec.sh

#to je menda obsolete
echo "update languages set VISIBLE=1 where LANG_ID=11"|/home/IGP/sqlexec.sh


#echo "select result from SET_PARAM('192.168.0.0', 'JP_PRESET', 'J_LEVEL1_MODE', '', '', 11, 1, '1');"|/home/ROULETTE/sqlexec.sh



exit 0
#SKOPIRAMO OPTIONALS iz WEB-A!!!
#TERM je unknown ko se zaganjamo iz beanshell iz symmetric-ds-a je TERM= "unknown", ce pa iz lxterminala je TERM=xterm-256color
#if [ "$TERM" = "unknown" ]; then
if [[ "$TERM" == *"xterm"* ]]; then
        WGET_OPT=" "
else
        #gremo v quiet, ce nismo iz xterm. V primeru ko ni terminala, se zabase output in se prenos ne konca
        WGET_OPT=" -q "
fi
REMOTE_DIR="LANDBASE_ROULETTE/RELEASE/OPTIONALS/"
REMOTE_FILE="EBX_GAMEART_nepal.tar.gz"
wget $WGET_OPT -O /tmp/$REMOTE_FILE http://rouletteupdates.4knh.com/$REMOTE_DIR/$REMOTE_FILE
# -h mora biti da ne povozi symlinkov med ekstrahiranjem
tar -h -xzf /tmp/$REMOTE_FILE -C /

