macos103-20031024
[openafs.git] / src / packaging / MacOS / OpenAFS.post_install
index 82f2534..6582275 100644 (file)
@@ -1,10 +1,24 @@
 #!/bin/sh
+# Portions Copyright (c) 2003 Apple Computer, Inc.  All rights reserved.
 if [ -d /afs -a ! -h /afs ]; then
    rmdir /afs
 fi
-mkdir -p /Network/afs
-if [ ! -h /afs ]; then
-  ln -s /Network/afs /afs
+majorvers=`uname -r | sed 's/\..*//'`
+if [ $majorvers -ge 7 ]; then
+  # /Network is now readonly, so put AFS in /afs; make sure /afs is a directory
+  if [ -e /afs ]; then
+    if [ -h /afs -o ! -d /afs ]; then
+      rm -f /afs
+      mkdir /afs
+    fi
+  else
+    mkdir /afs
+  fi
+else
+  mkdir -p /Network/afs
+  if [ ! -h /afs ]; then
+    ln -s /Network/afs /afs
+  fi
 fi
 
 cd /var/db/openafs/etc
@@ -13,6 +27,11 @@ if [ ! -f cacheinfo ]; then
    cp cacheinfo.sample cacheinfo
 fi
 
+if [ `grep /Network/afs cacheinfo` ]; then
+    cat cacheinfo |sed s#/Network/afs#/afs# > cacheinfo.new
+    mv cacheinfo.new cacheinfo
+fi
+
 # testing case -- upgrading from pre 1.2.7, but .last file exists.
 # merge the .save and .last....
 if [ ! -f CellServDB -a -f CellServDB.save -a -f CellServDB.master.last ]; then
@@ -49,3 +68,14 @@ if [ -z "$done" ]; then
     cp CellServDB.master CellServDB
   fi
 fi
+
+if [ $majorvers -ge 7 ]; then
+  # make config/settings.plist if it doesn't exist
+  if [ ! -e config/settings.plist -a -e config/settings.plist.orig ]; then
+    cp config/settings.plist.orig config/settings.plist
+  fi
+elif [ -e config/afssettings ]; then
+  # turn off execution of afssettings
+  chmod a-x config/afssettings
+fi
+