]> andersk Git - moira.git/blobdiff - gen/nfs.sh
In the past year, added: /mit/info/public-mailing-lists maintained
[moira.git] / gen / nfs.sh
index f9f6039a8fba79e83270f8b95acd57a13871aa8a..6f7d6c75f10ff05f08cbfa4597e89ce58cb7a348 100644 (file)
@@ -1,8 +1,7 @@
 #!/bin/csh -f
 # This script performs nfs updates on servers.
 #
-# $Source$
-echo '$Header$'
+# $Header$
 
 # The following exit codes are defined and MUST BE CONSISTENT with the
 # MR error codes the library uses:
@@ -10,7 +9,7 @@ set MR_NOCRED = 47836470
 set MR_MKCRED = 47836474
 set MR_TARERR = 47836476
 
-set path=(/etc /bin /usr/bin /usr/etc)
+set path=(/etc /bin /usr/bin /usr/etc /usr/athena/etc)
 set nonomatch
 
 # The file containg the information for the update
@@ -32,7 +31,7 @@ chmod 755 $SRC_DIR
 # incorrect.  For now however, it is probably not worth the effort
 # to canonicalize the hostname, especially with the upcoming update
 # protocol redesign
-set uchost=`/bin/hostname | tr a-z A-Z`.MIT.EDU
+set uchost=`hostname | tr '[a-z]' '[A-Z]'`.MIT.EDU
 
 cd $SRC_DIR
 
@@ -52,6 +51,8 @@ foreach type (dirs quotas)
        if ($status) exit $status
        if ($type == quotas) ./zero_quotas $dev < $i
        if ($status) exit $status
+       # save the files used here for later debugging
+       mv $i /tmp
      endif
    end
 end
@@ -61,7 +62,10 @@ rm -f /usr/etc/credentials.new
 cp ${uchost}.cred /usr/etc/credentials.new
 if ($status) exit $MR_NOCRED
 
-/usr/etc/mkcred /usr/etc/credentials.new
+# 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
 if ($status) exit $MR_MKCRED
 
 # Try to install the files
@@ -77,9 +81,9 @@ end
 
 
 # cleanup
-rm -f $TARFILE
-cd $SRC_DIR/..
-rm -rf $SRC_DIR
-rm $0
+  if [ -f $TARFILE ] ; then rm -f $TARFILE ; fi
+  if [ -d $SRC_DIR ] ; then cd $SRC_DIR/.. ; rm -rf $SRC_DIR ; fi
+  if [ -f $0 ] ; then rm -r $0 ; fi
+fi
 
 exit 0
This page took 0.033115 seconds and 4 git commands to generate.