Linux Step By Steps

NETSCAPE-Script Fix
From: Douglas J. Hunley


With all the netscape problems surrounding 4.72 and Caldera making 4.73 available and the announcement that you can now actually download Motif I whipped up a script to configure netscape. I've been using it for a couple days now, and netscape has stopped having fits. It's stopped doing the 'bus error' thing and I don't notice the 'not running on :0.0' error as much.

The script points netscape to the proper directory, sets up the classpath, sets up the plugin directory path, determines if motif is installed or not (and picks either the dynamic or static executable accordingly) and then launches netscape.

All right. Some people on this list had issues with my last version of this script. And I found some issues late last night on my own. So, I rechecked all my examples scripts and came up with a new derivative. PLEASE THROW AWAY MY OLD SCRIPT. Use the new one (attached).

0. Install the latest netscape
(http://hunley.homeip.net/linux_sources/utils/communicator-export-4.7-3.i386.rpm
1. save the attached somewhere ($HOME is fine)
2. cd /usr/bin
3. mv netscape netscape.old
4. cp $HOME/netscape /usr/bin
5. chmod 755 /usr/bin/netscape (as root)
6. play with netscape
7. report errors to me

Let's give this one a try shall we? Sorry for all the hassle with this script, but I think I got it right this time...
--

#!/bin/sh

# script to start netscape
#
# handles netscape <url>, netscape -mail, etc. formats
# adds classpath
# trys to contact running netscape and
# removes ~/.netscape/lock and restarts if this fails
# opens a new browser window if there are no args
# looks for file args and adds file:[pwd]
# start with caldera page if no startup.homepage
#
# Hacked out by Tim Riker <TimR@CalderaSystems.com>
# Further hacked to check for Motif libs to decide on
# the static or dynamic binary by Douglas Hunley <dhunley@columbus.rr.com>

export MOZILLA_HOME=/opt/netscape/communicator
export JAVA_DIR=$MOZILLA_HOME/java
export XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
export NPX_PLUGIN_PATH=$MOZILLA_HOME/plugins
export XENVIRONMENT=$MOZILLA_HOME/Netscape.ad

userdir=$HOME/.netscape
lock=$userdir/lock
pref=$userdir/preferences.js
start=file:///home/httpd/html/openlinux_help/index.html

if [ -e /usr/X11R6/lib/libXm.so.1.2.4 ]; then
netscape=$MOZILLA_HOME/netscape-dynMotif
else
netscape=$MOZILLA_HOME/netscape-statMotif
fi

if [ -f $pref ]; then
if grep "\"browser.startup.homepage\"" $pref >/dev/null; then
start=
fi
fi

if [ "$CLASSPATH" != "" ]; then
export CLASSPATH=$CLASSPATH:$JAVA_DIR
else
export CLASSPATH=$JAVA_DIR
fi

normal="$netscape"
#normal="$netscape -irix-session-management"
remote="$normal -noraise"
if [ -z "$*" ] ; then
if [ -n "$start" ] ; then
remote="$remote -remote openURL($start,new-window)"
else
remote="$remote -remote xfeDoCommand(openBrowser)"
fi
else
while [ -n "$1" ] ; do
case "$1" in
"-composer"|"-edit")
remote="$remote -remote xfeDoCommand(openEditor)"
normal="$normal $1"
start=
;;
"-messenger"|"-mail")
remote="$remote -remote xfeDoCommand(openInbox)"
normal="$normal $1"
start=
;;
"-discussions"|"-news")
remote="$remote -remote xfeDoCommand(openNewsgroups)"
normal="$normal $1"
start=
;;
"-display"|"-geometry"|"-visual"|"-ncols"|"-xrm"|"-remote"|"-id")
remote="$remote $1 $2"
normal="$normal $1 $2"
shift
;;
"-help")
exec $netscape -help
;;
-*)
remote="$remote $1"
normal="$normal $1"
;;
*)
url=$1
if [ -f "$url" -o -d "$url" ] ; then
if ! echo $url | grep '^/' >/dev/null; then
url="`pwd`/$url"
fi
url="file:$url"
fi
remote="$remote -remote openURL($url,new-window)"
normal="$normal $url"
start=
;;
esac
shift
done
if [ -n "$start" ] ; then
remote="$remote -remote openURL($start)"
normal="$normal $start"
fi
fi

if [ -L $HOME/.netscape/lock ] ; then
$remote
retcode=$?
sleep 1
if [ $retcode -ne 0 ] ; then
rm -f $HOME/.netscape/lock
exec $normal
fi
else
exec $normal
fi

--

The script is attached here. Enjoy!

searchSearch Index