#!/bin/sh

PORT=$(cat /opt/lsi/LSIStorageAuthority/conf/LSA.conf | grep client_listening_port | awk '{ print $3 }')

if [ -x /usr/bin/xdg-open ]; then
        nohup xdg-open http://localhost:$PORT > /dev/null 2>&1

elif [ -x /usr/bin/firefox ]; then
        nohup firefox --new-window http://localhost:$PORT > /dev/null 2>&1 &

else
        echo -n "Default browser (Mozilla Firefox) not present. Please open the link http://localhost:$PORT in the web browser of your choice."
        echo
        sleep 5
fi

