#!/bin/bash
u="NO"
ME=$(dirname ${0})
if [ -f "${HOME}/.SkyLIVE.app/Contents/MacOS/skylive-ng" ] ; then
   if [ -f "${HOME}/.SkyLIVE.app/Contents/MacOS/VERSION.txt"  ] ; then
      if [ -f "${ME}/VERSION.txt" ] ; then
         rv=$(cat "${ME}/VERSION.txt")
         uv=$(cat "${HOME}/.SkyLIVE.app/Contents/MacOS/VERSION.txt")
         if [ "$uv" -gt "$rv"  ] ; then
            u="OK"
         fi
      else
         u="OK"
      fi
   fi
fi
if [ "$u" = "OK" ] ; then
   ${HOME}/.SkyLIVE/Contents/MacOS/skylive-ng $@ &
   disown %1
else
   ${ME}/skylive-ng.bin $@ &
   disown %1
fi 
