From de9119ebe0d68c9612a579dd14920008f5accd44 Mon Sep 17 00:00:00 2001 From: qjb Date: Sat, 6 Aug 1988 16:41:53 +0000 Subject: [PATCH] fixed a syntax error --- gen/hesiod.sh | 18 ++++++++++-------- gen/install_dirs | 4 ++-- gen/nfs.sh | 12 ++++++------ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/gen/hesiod.sh b/gen/hesiod.sh index a232acda..95c9ba8c 100644 --- a/gen/hesiod.sh +++ b/gen/hesiod.sh @@ -26,7 +26,9 @@ endif # parition, so find out where $DEST_DIR is and put $SRC_DIR there too. set old = $cwd chdir $DEST_DIR -set SRC_DIR_TMP = $cwd:h/_nameserver +# Don't use $cwd; it won't follow the link +set CUR_DIR = `pwd` +set SRC_DIR_TMP = $CUR_DIR:h/_nameserver if (! -d $SRC_DIR_TMP) then /bin/rm -f $SRC_DIR_TMP /bin/mkdir $SRC_DIR_TMP @@ -37,26 +39,26 @@ cd $old unset old SRC_DIR_TMP # Alert if tarfile doesn't exist -if (! -r $TARFILE) exit SMS_MISSINGFILE +if (! -r $TARFILE) exit $SMS_MISSINGFILE # Empty the tar file one file at a time and move each file to the # appropriate place only if it is not zero length. cd $SRC_DIR -foreach file (`/bin/tar tf $TARFILE | awk '{print $1}'`) - if (./ == $file) continue +foreach file (`/bin/tar tf $TARFILE | awk '{print $1}' | sed 's;/$;;'`) + if (. == $file) continue rm -rf $file echo extracting $file /bin/tar xf $TARFILE $file # Don't put up with errors extracting the information - if ($status) exit SMS_TARERR + if ($status) exit $SMS_TARERR # Make sure the file is not zero-length if (! -z $file) then /bin/mv -f $file $DEST_DIR - if ($status != 0) exit SMS_HESFILE + if ($status != 0) exit $SMS_HESFILE else /bin/rm -f $file - exit SMS_MISSINGFILE + exit $SMS_MISSINGFILE endif end @@ -90,7 +92,7 @@ while ($i < $TIMEOUT) end # Did it time out? -if ($i == $TIMEOUT) exit SMS_NAMED +if ($i == $TIMEOUT) exit $SMS_NAMED # Clean up! /bin/rm -f $TARFILE diff --git a/gen/install_dirs b/gen/install_dirs index 9dc45a10..376113a7 100644 --- a/gen/install_dirs +++ b/gen/install_dirs @@ -17,7 +17,7 @@ set USERTAR = /tmp/proto.tar # Tarfile for user . files rm -rf $USERTAR rm -rf $TMPSTOR mkdir $TMPSTOR -if ($status) exit SMS_PROTO +if ($status) exit $SMS_PROTO # Make a tarfile containing the user prototype files for future use. (cd /usr/prototype_user;tar cf - .) | (cd $TMPSTOR; tar xpf -) @@ -26,7 +26,7 @@ rm -f $TMPSTOR/welcome chmod -R 444 $TMPSTOR chmod 700 $TMPSTOR/Mail (cd $TMPSTOR; tar cf $USERTAR .) -if ($status) exit SMS_PROTO +if ($status) exit $SMS_PROTO rm -rf $TMPSTOR # So that the new directories get the right protections. diff --git a/gen/nfs.sh b/gen/nfs.sh index 2e48ee72..f174f304 100644 --- a/gen/nfs.sh +++ b/gen/nfs.sh @@ -21,7 +21,7 @@ chmod 755 $SRC_DIR # Alert if the tarfile does not exist if (! -r $TARFILE) then - exit SMS_TARERR + exit $SMS_TARERR endif # Note that since SMS is going to be exported, assuming .MIT.EDU is @@ -40,7 +40,7 @@ foreach file (`/bin/tar tf $TARFILE | awk '{print $1}'`) ($file =~ ./install_*) || \ ($file =~ ./list-*)) then tar xf $TARFILE $file - if ($status) exit SMS_TARERR + if ($status) exit $SMS_TARERR endif end @@ -52,17 +52,17 @@ foreach type (dirs quotas) 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_SMS_NOCRED /usr/etc/mkcred /usr/etc/credentials.new -if ($status) exit SMS_MKCRED +if ($status) exit $SMS_MKCRED # Try to install the files foreach e ( "" .dir .pag) @@ -71,7 +71,7 @@ end # If any of them didn't get installed, fail foreach e ( "" .dir .pag) - if (! -e /usr/etc/credentials$e) exit SMS_NOCRED + if (! -e /usr/etc/credentials$e) exit $SMS_NOCRED end # cleanup -- 2.45.2