source: trunk/packs/maint/local-netscape.sh @ 14969

Revision 14969, 2.3 KB checked in by ghudson, 24 years ago (diff)
We need to copy www/netscape for the default bookmarks file for first-time users.
Line 
1#!/bin/sh
2# $Id: local-netscape.sh,v 1.4 2000-07-29 14:19:07 ghudson Exp $
3
4# local-netscape: A cron job to copy part of the infoagents locker onto
5# local disk so that netscape can be started more quickly.
6
7PATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin:/bin/athena:/usr/athena/bin:/usr/athena/etc
8export PATH
9
10local=/var/athena/infoagents
11rconf=/var/athena/rconf.infoagents
12
13# Attach the infoagents locker and get its mountpoint.
14locker=`attach -pn infoagents`
15if [ -z "$locker" ]; then
16  exit
17fi
18
19# Make sure we have 100MB of space available under /var if this is the
20# first time we're bringing netscape local.  Note that df's -P option
21# is only supported by /usr/xpg4/bin/df on Solaris 7; thus the
22# /usr/xpg4/bin at the beginning of the PATH above.
23space=`df -kP /var/athena | awk '{ x = $4; } END { print x; }'`
24if [ ! -d "$local" -a "$space" -lt 102400 ]; then
25  exit
26fi
27
28# Remove netscape.adjusted until everything is properly set up.
29# /usr/athena/bin/netscape will use the infoagents locker in the
30# meantime.
31bin=`athdir $local`
32if [ -n "$bin" ]; then
33  rm -f "$bin/netscape.adjusted"
34fi
35
36version=1
37if [ -r "$locker/.syncversion" ]; then
38  if [ `cat "$locker/.syncversion"` -gt $version ]; then
39    exit
40  fi
41fi
42
43# Write out the rconf file.
44arch=`athdir -t "" -p "$locker" | sed -e "s,^$locker/,," -e 's,/$,,'`
45if [ -z "$arch" ]; then
46  exit
47fi
48rm -f $rconf
49cat > $rconf << EOF
50delete *
51copy www -f
52copy www/netscape -f
53copy www/netscape/* -f
54copy share -f
55copy share/Netscape -f
56copy share/Netscape/* -f
57copy share/app-defaults -f
58copy share/app-defaults/* -f
59copy arch -f
60copy arch/share -f
61copy arch/share/* -f
62chase $arch
63copy $arch -f
64copy $arch/* -f
65delete $arch/MIT-only/*
66chase $arch/MIT-only/netscape
67copy $arch/MIT-only/netscape
68copy $arch/MIT-only/netscape/*
69EOF
70
71# Do the synctree of the locker.
72mkdir -p $local
73synctree -q -nosrcrules -nodstrules -s "$locker" -d $local -a $rconf
74if [ $? -ne 0 ]; then
75  rm -rf "$local"
76  exit
77fi
78
79# Make sure the local copy of the locker is readable.
80find $local \( -type f -o -type d \) -print | xargs chmod a+rX
81
82# Massage the netscape startup script.
83script=$local/arch/share/bin/netscape
84if [ -x "$script" ]; then
85  rm -f "$script.adjusted"
86  sed -e "s,$locker,$local,g" -e 's,^progname=.*$,progname=netscape,' \
87    "$script" > $script.new
88  chmod a+x "$script.new"
89  mv "$script.new" "$script.adjusted"
90fi
Note: See TracBrowser for help on using the repository browser.