]> andersk Git - moira.git/blobdiff - gen/nfs.sh
update for 8.3 (oops)
[moira.git] / gen / nfs.sh
index 1a4baaa14689908ae716b661d0bcc486d73c5bfb..3304f4fdc9405360e3477e36734409e76c12247d 100644 (file)
@@ -4,7 +4,7 @@
 # $Header$
 
 # The following exit codes are defined and MUST BE CONSISTENT with the
-# MR error codes the library uses:
+# error codes the library uses:
 set MR_NOCRED = 47836470
 set MR_MKCRED = 47836474
 set MR_TARERR = 47836476
@@ -27,11 +27,10 @@ rm -rf $SRC_DIR
 mkdir $SRC_DIR
 chmod 755 $SRC_DIR
 
-# Note that since MR is going to be exported, assuming .MIT.EDU is
-# incorrect.  For now however, it is probably not worth the effort
-# to canonicalize the hostname, especially with the upcoming update
-# protocol redesign
-set uchost=`hostname | tr '[a-z]' '[A-Z]'`.MIT.EDU
+set uchost=`hostname | tr '[a-z]' '[A-Z]'`
+if ($uchost !~ *.*) then
+    set uchost=$uchost.MIT.EDU
+endif
 
 cd $SRC_DIR
 
@@ -57,28 +56,34 @@ foreach type (dirs quotas)
    end
 end
 
+# find credentials directory (not robust, but works for the current
+# situation)
+set creddir = /var/athena
+if (-d /usr/etc) then
+    set creddir = /usr/etc
+endif
+
 # build new credentials files.
-rm -f /usr/etc/credentials.new
-cp ${uchost}.cred /usr/etc/credentials.new
+rm -f $creddir/credentials.new
+cp ${uchost}.cred $creddir/credentials.new
 if ($status) exit $MR_NOCRED
-if (-e /usr/etc/credentials.local) then
-    cat /usr/etc/credentials.local >> /usr/etc/credentials.new
+if (-e $creddir/credentials.local) then
+    cat $creddir/credentials.local >> $creddir/credentials.new
 endif
 
 # After this point, if /tmp gets cleared out by reactivate (which
 # happens on a combined server/workstation) we don't care.
-
-mkcred /usr/etc/credentials.new
+mkcred $creddir/credentials.new
 if ($status) exit $MR_MKCRED
 
 # Try to install the files
 foreach e ( "" .dir .pag)
-   mv -f /usr/etc/credentials.new$e /usr/etc/credentials$e
+   mv -f $creddir/credentials.new$e $creddir/credentials$e
 end
 
 # If any of them didn't get installed, fail
 foreach e ( "" .dir .pag)
-   if (! -e /usr/etc/credentials$e) exit $MR_NOCRED
+   if (! -e $creddir/credentials$e) exit $MR_NOCRED
 end
 
 
This page took 0.149632 seconds and 4 git commands to generate.