#!/bin/bash
# ----------------------------------------------------------------------------
# Mozilla Setup Helper for GNU/Linux - "Have Plugins" Template (modified)
# Copyright (c)  2002 Thomas Lahn <PointedEars@gmx.de>
#
# Called without arguments, this program installs
#
# - the current Mozilla Linux release setup to /tmp
# - already installed plugins from /usr/local/netscape/plugins/
# - the applications
#   * Preferences Toolbar 2.2.2
#     from ../_applications/prefbar-2.2.2.xpi
#   * Message-ID Finder 1.4.5.
#     from ../_applications/messageidfinder.xpi
#
# You can modify the default behavior using the arguments
#
# $1    to define the path from which Mozilla Linux setup should be installed.
#       use - for the default
# $2-*  to define additional XUL applications (by their XPI) to be installed
#
# If your configuration does not match the defaults defined herein AND cannot
# be matched using these arguments, use the Mozilla Setup Wizard for GNU/Linux
# instead. Type `mozilla-linux-setup' for details.
#
# Send suggestions and bug reports to <bug-mozilla@PointedEars.de>
# ----------------------------------------------------------------------------

dir=`dirname $0 2> /dev/null`

what="~/Downloadz/_Mozilla/_releases/mozilla-1.3b-i686-pc-linux-gnu-sea.tar.gz"
test -n "$1" -a "$1" != "-" && what=$1
shift

xpi_list=("prefbar-2.2.2" "messageidfinder-1.4.5")
xpi_path=~/Downloadz/_Mozilla/_applications/
for i in `seq 0 $((${#xpi_list[*]}-1))`; do
  xpi_list[$i]=$xpi_path${xpi_list[$i]}
done

if [ -x ${dir:-.}/mozilla-linux-setup ]; then
  ${dir:-.}/mozilla-linux-setup $what -c -i ${xpi_list[*]} $*
else
  echo
  echo "Sorry, this requires PE's Mozilla Setup Wizard"
  echo "for GNU/Linux executable as mozilla-linux-setup"
  echo
fi
