#!/bin/sh
# author - David Patton
# seriously modified by - Carlos Urbieta Cabrera <cucnews at yahoo dot com>
# reworked by - Carlos Urbieta Cabrera <cucnews at yahoo dot com> again ;)
# THIS SOFTWARE HAS THE GPL LICENSE, IF YOU USE THIS SOFTWARE, YOU ARE
# AGREEING TO ITS LICENSE´S TERMS, SO AT LEAST READ IT! 8D
# http://www.gnu.org/licenses/licenses.html#TOCGPL
#***
# Configurarion starts here

# Where is phoenix?
PHOENIX=/usr/lib/phoenix/phoenix

# Default URL when not set at command line?
DEFAULT="www.checa.ath.cx/a/"

# Configurarion stops here
#***
URL="$@"
   if [ "$URL" = "" ]; then
      URL="$DEFAULT"
   fi

$PHOENIX -remote "ping()"
# $? = false if running, true if not
   if [ $? = 0 ] ; then
      $PHOENIX -remote openURL"($URL,new-window)"
                                # 'new-tab' also exists, but it
                                # will not bring the browser
                                # ontop, so its not that fun.
                                # People may not realize that
                                # there is a new tab on their 
                                # current browser 8) -Carlos
   else
      $PHOENIX $URL
   fi
exit

#***
#Changelog: 
#
# 2003/02/20
# * Major upgrade, now using a much simpler and cleaner method
#   but only works on 1+ versions of mozilla (not sure) where
#   ping() is supported.
#   Now it has the option to set up a default URL and overides
#   it if another URL is declared when invoking the command 8)
#   This last upgrade was made possible by tips from Jan Wilson
#   at the ltsp mailing list 8)
# 
#
# 2003/01/24
# * Davids script used a simple ps -e without checking for users, so
#   his was monouser, this new version is multiuser, propper for 
#   the linux terminal server project (hey guys!) 8) -Carlos
#
# 2003/01/22
# Yes this script is big enough for a change log! 8) -Carlos
#
#***
#TODO
#
# Knock yourself out, send your changes back to me, you agreed to it
# remember? 8)
#
#***