#!/bin/sh
#API_DB_NAME=ext_auth

#export THIS_DIR="$(cd "$( dirname "$0" )" && pwd )"
#. $THIS_DIR/../../sysbase/tools/export_php_config_to_shell.sh

#echo "create database IF NOT EXISTS $API_DB_NAME" | mysql -f -u $API_DB_USER --password=$API_DB_PASSWD 2>&1 | grep -v 'password on the command line' || true
#mysql -h $API_DB_HOST -u $API_DB_USER --password=$API_DB_PASSWD $API_DB_NAME < "$THIS_DIR/mysql/create_tables.sql" 2>&1 | grep -v 'password on the command line' || true

if [ ! -d /var/log/api/ext_auth/ ];then
    mkdir -p /var/log/api/ext_auth/
fi
chown apache:apache -R /var/log/api/ext_auth/

cd /var/www/html/ext_auth/
ln -sf external_basic_authentication local_external_basic_authentication