SUMMARY: Netscape V4.51 proxy settings?

From: Richard Bemrose <rb237_at_phy.cam.ac.uk>
Date: Thu, 15 Apr 1999 17:52:17 +0100 (BST)

Hi,

I must first thank the following for their speedy replies:
  Stanley Horwitz <stan_at_astro.ocis.temple.edu>,
  Bob Vickers <R.Vickers_at_dcs.rhbnc.ac.uk>,
  Jim Bostwick <Jim_Bostwick_at_cargill.com>

I my original (and admittedly rather misleading) poster I ask who I can
enforce all users to use the proxy cache, for example implement global
preferences (not individual). Bob Vickers hit the nail on the head and
suggested using a (k)shell wrapper around Netscape. Bob gracefully provided
an example script which can be customised as required. Thanks!

-- cut --
#!/bin/ksh
# manufacture a basic Netscape Preferences File
# Version: 4.5

set -e
set -o nounset
set -o noclobber

# Set standard RH PATH (in case user has changed it).
PATH=/usr/bin/mh:/usr/local/bin:/usr/local/bin/X11:/usr/bin/X11
PATH=$PATH:/usr/bin:/bin
export PATH

# Make sure we are not superuser, because running netscape as root is pretty
# dangerous.
if [[ -O /bin/su ]]
then
    echo >&2 "$0: Running netscape as superuser is unsafe"
    exit 1
fi

# define various directories and files
initdir="$HOME/.netscape"
initfile=$initdir/preferences.js
bookmarks=$initdir/bookmarks.html
MOZILLA_HOME=/usr/local/netscape-communicator-v45
export MOZILLA_HOME
real_netscape="$MOZILLA_HOME/netscape"


# There seems to be a bug in netscape 3.0 which caused problems when
# changing the cache directory. So we use a soft link instead.
realcachedir=/nobackup/work/$USER/.netscape-cache
logicalcachedir=$initdir/cache

# Make sure cache directory and configuration directory exist
for dir in $realcachedir $initdir
do
    if [ ! -d $dir ]
    then
        mkdir -p $dir
    fi
done

# Set up link from logical cache directory to real one

if [ -d $logicalcachedir -a ! -L $logicalcachedir ]
then
    # delete old cache from home directory
    echo >&2 "(Deleting old cache directory $logicalcachedir ...)"
    rm -r $logicalcachedir
fi
if [ ! -L $logicalcachedir ]
then
    ln -s $realcachedir $logicalcachedir
    # Make archive directory to prevent misleading error message
    mkdir $initdir/archive
fi

# Make sure there is a bookmarks file
if [ ! -w $bookmarks ]
then
    echo >&2 '(creating default bookmarks file...)'
    cp $MOZILLA_HOME/bookmark.htm $bookmarks
fi

# Make sure there is a preferences file
if [ ! -r $initfile ]
then
    echo >&2 '(creating customized default Netscape preferences for you ...)'
    me=`finger -m $USER | head -1 |
        awk '{ split($0,z,":");print substr(z[3],2)}'`
    email=$USER_at_dcs.rhbnc.ac.uk
    org="Royal Holloway University of London"
    homepage="http://www.cs.rhbnc.ac.uk/"
    cat <<EOF > $initfile
// RHUL cache values
user_pref("browser.cache.disk_cache_size", 500);
user_pref("browser.cache.memory_cache_size", 1000);
// RHUL Compsci home page
user_pref("browser.startup.homepage", "http://www.cs.rhbnc.ac.uk/");
// Mail defaults (Pine compatible)
user_pref("mail.default_fcc", "$HOME/mail/sent-mail");
user_pref("mail.directory", "$HOME/mail/");
user_pref("mail.html_compose", false); // Send text messages, NOT html
// RHUL organisation
user_pref("mail.identity.organization", "$org");
user_pref("mail.identity.useremail", "$email");
user_pref("mail.identity.username", "$me");
// RHUL proxy setup
user_pref("network.proxy.autoconfig_url", "http://www.cs.rhbnc.ac.uk/proxy.pac");
user_pref("network.proxy.type", 2);
// NEWS stuff
user_pref("news.default_fcc", "$HOME/mail/sent-mail");
// RHUL print defaults (greyscale, A4)
user_pref("print.print_color", false);
user_pref("print.print_paper_size", 3);
EOF

fi

# Set time limit because orphan netscapes sometimes loop forever.
ulimit -t 1200 # 20 minutes CPU

# The -name option is to avoid confusing the users' X resources
# if you change the actual name of the executable.
set +o nounset
# Disable systemwide X resources (TEMP)
XFILESEARCHPATH="" ; export XFILESEARCHPATH
exec $real_netscape -name netscape "$_at_"
-- cut --



Regards,
Rich

 /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
/_/ Richard A Bemrose /_\ Polymers and Colloids Group \_\
/_/ email: rb237_at_phy.cam.ac.uk /_\ Cavendish Laboratory \_\
/_/ Tel: +44 (0)1223 337 267 /_\ University of Cambridge \_\
/_/ Fax: +44 (0)1223 337 000 /_\ Madingley Road \_\
/_/ Mobile: +44 (0)410 168 873 / \ Cambridge, CB3 0HE, UK \_\
 /_/_/_/_/_/_/ http://www.poco.phy.cam.ac.uk/~rb237 \_\_\_\_\_\_\_\
             "Life is everything and nothing all at once"
              -- Billy Corgan, Smashing Pumpkins
Received on Thu Apr 15 1999 - 16:55:04 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT