#!/bin/sh
#set -x # Uncomment "set -x" for debugging

export MOZILLA_FIVE_HOME="/usr/local/firefox"
FIREBIRD_PATH="/usr/local/firefox"

if [ -z "`ps x | grep \"[0-9] ${FIREBIRD_PATH}/firefox-bin\"`" ]; then
    # No MozillaFirefox running
    ${FIREBIRD_PATH}/firefox $@
else
    # MozillaFirefox running - open a new window
    ${FIREBIRD_PATH}/firefox -a firefox -remote "openURL($@,new-tab)"
fi 
