#!/bin/sh

# script file to launch the Mozilla
# created by Geoffrey Lee <snailtalk@linux-mandrake.com>

# test if we should upgrade from 4.x

if [ -d "$HOME/.netscape" -a ! -d "$HOME/.mozilla" ]; then
	if [ -z `echo "$@" | grep '\-install'` ];then
		foo="-install"
	fi
fi

# test for url, this method sux, yes i know..

if [ -z `echo $@ | grep '://'` ]; then
	if [ -f /usr/doc/HTML/index.html ]; then
		foo="$foo $@ file://usr/doc/HTML/index.html"
	else
		foo="$foo $@ http://www.linux-mandrake.com"
	fi
else
	foo="$foo $@"
fi


# print args to stdout, run mozilla
# adding options in front of url will show about:blank for some reason
# there is nothign wrong with my sh code.
# if you don't believe me then comment the five lines of code above
# and uncomment the line below.

# foo="/usr/doc/HTML/index.html



echo running mozilla with args \""$foo"\"
MOZILLA_FIVE_HOME=/usr/lib/mozilla exec /usr/bin/mozilla-bin "$foo" 

