#!/bin/sh

# Do not run as CGI
if [ -n "$GATEWAY_INTERFACE" ] ; then
    echo 'Can not invoke as CGI!'
    exit 1
fi

set -e
set -x

if [ -z  "$SELENIUM" ] ; then
    exit 0
fi

mkdir -p ~/browserstack
cd ~/browserstack
if [ ! -f BrowserStackLocal ] ; then
    wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip
    unzip BrowserStackLocal-linux-x64.zip
fi

