]> andersk Git - moira.git/blobdiff - gen/nfs.sh
Diane Delgado's changes for a fixed table-locking order
[moira.git] / gen / nfs.sh
index a400eb260c79dc6d4e2b6167175942912b59ce44..21c1899353f27940752833a6a91f29e0a0b39868 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:
@@ -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
 
@@ -63,6 +62,9 @@ rm -f /usr/etc/credentials.new
 cp ${uchost}.cred /usr/etc/credentials.new
 if ($status) exit $MR_NOCRED
 
+# 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
 
@@ -79,9 +81,11 @@ end
 
 
 # cleanup
-rm -f $TARFILE
-cd $SRC_DIR/..
-rm -rf $SRC_DIR
-rm $0
+if ( -f $TARFILE ) rm -f $TARFILE
+if ( -d $SRC_DIR ) then
+  cd $SRC_DIR/..
+  rm -rf $SRC_DIR
+endif
+if ( -f $0 ) rm -r $0
 
 exit 0
This page took 0.040968 seconds and 4 git commands to generate.