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). |
---|
5 | menutar=/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. |
---|
9 | menudir=/usr/athena/share/gnome/athena/menus |
---|
10 | |
---|
11 | # Local copy of the menu tar file. |
---|
12 | localtar=/var/athena/menus.tar |
---|
13 | |
---|
14 | # Local copy of the menu directory (made from the tar file, not from |
---|
15 | # $menudir). |
---|
16 | localdir=/var/athena/menus.copy |
---|
17 | |
---|
18 | # What panel refers to; will be a symlink to either $localdir or |
---|
19 | # $menudir. |
---|
20 | menus=/var/athena/menus |
---|
21 | |
---|
22 | fail() { |
---|
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. |
---|
29 | if [ ! -s $menutar ]; then |
---|
30 | fail |
---|
31 | fi |
---|
32 | |
---|
33 | # Nothing to do if $localtar is up to date. |
---|
34 | if [ -s $localtar ] && \ |
---|
35 | [ "`find $menutar -follow -newer $localtar`" != $menutar ]; then |
---|
36 | exit 0 |
---|
37 | fi |
---|
38 | |
---|
39 | # Update the local menus area. |
---|
40 | cp $menutar $localtar || fail |
---|
41 | rm -rf $localdir |
---|
42 | mkdir $localdir || fail |
---|
43 | (cd $localdir && tar xof $localtar) || fail |
---|
44 | chmod -R a+rX $localdir || fail |
---|
45 | rm -rf $menus |
---|
46 | ln -s $localdir $menus |
---|
Note: See
TracBrowser
for help on using the repository browser.