Finish afscell implementation work
[openafs.git] / src / packaging / MacOS / OpenAFS.post_install
index 96281e6..9483b9d 100644 (file)
@@ -32,6 +32,19 @@ if [ `grep /Network/afs cacheinfo` ]; then
     mv cacheinfo.new cacheinfo
 fi
 
+# if the installer plugin generated ThisCell and/or CellAlias
+# files, copy them in here
+tmpthiscell=/private/tmp/org.OpenAFS.Install.ThisCell.$USER
+tmpcellalias=/private/tmp/org.OpenAFS.Install.CellAlias.$USER
+if [ -f $tmpthiscell ]; then
+    cp $tmpthiscell ThisCell
+    rm -f $tmpthiscell
+fi
+if [ -f $tmpcellalias ]; then
+    cp $tmpcellalias CellAlias
+    rm -f $tmpcellalias
+fi
+
 if [ ! -f ThisCell -a -f ThisCell.sample ]; then
    cp ThisCell.sample ThisCell
 fi
@@ -44,8 +57,17 @@ if cmp -s config/afsd.options.broken config/afsd.options ; then
 fi
 rm -f config/afsd.options.broken
 
-if [ ! -f config/afsd.options -a -f config/afsd.options.sample ]; then
-   cp config/afsd.options.sample config/afsd.options
+# if the user hasn't changed these settings, then they should just use the new
+# afsd.conf file
+rm -f config/afsd.options.old
+echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' >config/afsd.options.old
+if cmp -s config/afsd.options.old config/afsd.options ; then
+   rm -f config/afsd.options
+fi
+rm -f config/afsd.options.old
+
+if [ ! -f config/afs.conf -a -f config/afs.conf.sample ]; then
+   cp config/afs.conf.sample config/afs.conf
 fi
 
 # testing case -- upgrading from pre 1.2.7, but .last file exists.
@@ -99,3 +121,7 @@ elif [ -e config/afssettings ]; then
   # turn off execution of afssettings
   chmod a-x config/afssettings
 fi
+
+#here we should run tools which configure the client, and then if it's enabled:
+/Library/StartupItems/OpenAFS/OpenAFS start
+