home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 11.ddi / usr / lib / uucp / Teardown < prev    next >
Encoding:
Text File  |  1990-12-08  |  907 b   |  44 lines

  1. #!/usr/bin/sh
  2. #ident    "@(#)/usr/lib/uucp/Teardown.sl 1.1 4.0 12/08/90 47300 AT&T-USL"
  3.  
  4. export IFS PATH
  5. IFS="     
  6. "
  7. PATH="/usr/bin"
  8.  
  9. #
  10. #    This shell tries to convert uucp from the QFT format back to the
  11. #    the regular HoneyDanBer format and removes all sub directories
  12. #    that created while running the QFT version of uucp.
  13. #
  14.  
  15. echo "Converting uucp from QFT Format back to HoneyDanBer format\n"
  16.  
  17. SPOOL=/var/spool/uucp
  18. #    chdir to remote spool directory
  19. cd $SPOOL
  20. if [ `pwd` != "$SPOOL" ]
  21. then
  22.     echo "CAN'T cd to $SPOOL"
  23.     echo "$0 failed."
  24.     exit 0
  25. fi
  26. for d in */?
  27. do
  28. #    chdir to grade directories of the remote
  29.     cd $d
  30.     if [ "$?" = 0 ]
  31.     then
  32. #       move everything to parent (machine) directory
  33.        find . -print | cpio -pdvm ..
  34.        if [ "$?" = 0 ]
  35.        then
  36. #        now remove everything in this directory
  37.         rm -rf *
  38.        fi
  39.        cd $SPOOL
  40. #       if grade directory is now empty, remove it.
  41.        rmdir $d
  42.     fi
  43. done >/dev/null 2>&1
  44.