]> andersk Git - moira.git/blobdiff - gen/nfs.sh
install startdcm correctly
[moira.git] / gen / nfs.sh
index f174f30400fa065179125fc4cfc7953e51123f2a..9c4c11706aeebddce363c8b98a2e5bc4909ad8d7 100644 (file)
@@ -1,11 +1,14 @@
 #!/bin/csh -f
 # This script performs nfs updates on servers.
+#
+# $Source$
+echo '$Header$'
 
 # The following exit codes are defined and MUST BE CONSISTENT with the
 # SMS error codes the library uses:
-set SMS_NOCRED 47836470
-set SMS_MKCRED 47836474
-set SMS_TARERR 47836476
+set SMS_NOCRED 47836470
+set SMS_MKCRED 47836474
+set SMS_TARERR 47836476
 
 set path=(/etc /bin /usr/bin /usr/etc)
 
@@ -14,16 +17,16 @@ set TARFILE=/tmp/nfs.out
 # The directory into which we will empty the tarfile
 set SRC_DIR=/tmp/nfs.dir
 
-# Create a frash source directory
-rm -f $SRC_DIR
-mkdir $SRC_DIR
-chmod 755 $SRC_DIR
-
 # Alert if the tarfile does not exist
 if (! -r $TARFILE) then
    exit $SMS_TARERR
 endif
 
+# Create a fresh source directory
+rm -rf $SRC_DIR
+mkdir $SRC_DIR
+chmod 755 $SRC_DIR
+
 # Note that since SMS 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
@@ -48,18 +51,17 @@ foreach type (dirs quotas)
    echo "Installing ${type}:"
    foreach i ( ${uchost}*.${type} )
       # Convert the from the filename HOST.@dev@device.type to /dev/device
-      set dev=`echo $i |  sed 's;.${type};;' | sed 's;${uchost}.;;' | \
-          sed 's;@;/;g'`
+      set dev=`echo $i |  sed "s,.${type},," | sed "s,${uchost}.,," | sed "s,@,/,g"`
       echo ${uchost}:$dev
       ./install_${type} $dev < $i
-      if ($status) exit $$status
+      if ($status) exit $status
    end
 end
 
 # build new credentials files.
 rm -f /usr/etc/credentials.new
 cp ${uchost}.cred /usr/etc/credentials.new
-if ($status) exit $SMS_SMS_NOCRED
+if ($status) exit $SMS_NOCRED
 
 /usr/etc/mkcred /usr/etc/credentials.new
 if ($status) exit $SMS_MKCRED
@@ -74,6 +76,8 @@ foreach e ( "" .dir .pag)
    if (! -e /usr/etc/credentials$e) exit $SMS_NOCRED
 end
 
+
+
 # cleanup
 rm -f $TARFILE
 cd $SRC_DIR/..
@@ -81,8 +85,3 @@ rm -rf $SRC_DIR
 rm $0
 
 exit 0
-
-#
-#      $Source$
-#      $Header$
-#
This page took 0.034399 seconds and 4 git commands to generate.