source: trunk/packs/maint/local-menus.sh @ 16304

Revision 16304, 1.2 KB checked in by ghudson, 24 years ago (diff)
Don't use symlink mod time.
Line 
1#!/bin/sh
2# $Id: local-menus.sh,v 1.3 2001-06-12 17:14:22 ghudson Exp $
3
4# Tar file containing menus (a symlink into the AFS system config area).
5menutar=/usr/athena/share/gnome/athena/menus.tar
6
7# Menu directory; used as a fallback if we can't make a local copy of
8# the menus.
9menudir=/usr/athena/share/gnome/athena/menus
10
11# Local copy of the menu tar file.
12localtar=/var/athena/menus.tar
13
14# Local copy of the menu directory (made from the tar file, not from
15# $menudir).
16localdir=/var/athena/menus.copy
17
18# What panel refers to; will be a symlink to either $localdir or
19# $menudir.
20menus=/var/athena/menus
21
22fail() {
23  rm -f $menus $localtar        # Removing $localtar ensures we will try again.
24  ln -s $menudir $menus
25  exit 1
26}
27
28# Fail quietly if the menu tar file doesn't exist.
29if [ ! -s $menutar ]; then
30  fail
31fi
32
33# Nothing to do if $localtar is up to date.
34if [ -s $localtar ] && \
35   [ "`find $menutar -follow -newer $localtar`" != $menutar ]; then
36  exit 0
37fi
38
39# Update the local menus area.
40cp $menutar $localtar || fail
41rm -rf $localdir
42mkdir $localdir || fail
43(cd $localdir && tar xof $localtar) || fail
44chmod -R a+rX $localdir || fail
45rm -rf $menus
46ln -s $localdir $menus
Note: See TracBrowser for help on using the repository browser.