home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / elec_svcs.idb / usr / lib / ES / bin / usr2varspool.csh.z / usr2varspool.csh
Encoding:
Linux/UNIX/POSIX Shell Script  |  1997-02-07  |  1.3 KB  |  58 lines

  1. #! /bin/csh -f
  2.  
  3. set RM = /bin/rm
  4. set TOUCH = /bin/touch
  5. set MV = /bin/mv
  6. set LN = /bin/ln
  7. set CP = /bin/cp
  8.  
  9. # //////////////////////////////////////////////////////////////////////////
  10. echo "==================================================================="
  11. echo "Date: `date`"
  12.  
  13. if ( -l /usr/spool ) then
  14.    echo "/usr/spool is already a link. Done."
  15.    exit 0
  16. endif
  17.  
  18. if ( ! -d /var/spool/es ) then
  19.    mkdir /var/spool/es
  20. endif
  21.  
  22. # Now test if /usr/spool/es is a link
  23. if ( -l /usr/spool/es ) then
  24.    ${RM} -f /usr/spool/es
  25. else
  26.    if ( -d /usr/spool/es ) then
  27.         echo "/usr/spool/es directory exist..."
  28.     foreach i (`ls /usr/spool/es`)
  29.         echo "  -- Copying file/dir= $i to /var/spool/es..."
  30.         ${CP} -r /usr/spool/es/$i /var/spool/es
  31.         if ( $status != 0 ) then
  32.         echo "== Copying files failed.. "
  33.         echo "== Please refer to elec_svcs_callsvr relnotes chapter 2.6"
  34.         exit 1
  35.         endif
  36.         end
  37.     echo "== Files have been copied from /usr/spool/es to /var/spool/es."
  38.     ${RM} -fr /usr/spool/es
  39.     echo "== Old /usr/spool/es has been removed."
  40.    endif
  41. endif
  42.    
  43. if ( -s /usr/spool/es ) then
  44.     ${MV} /usr/spool/es /usr/spool/es/.old
  45. endif
  46.  
  47. if ( ! -d /usr ) then
  48.     mkdir /usr 
  49. endif
  50.  
  51. if ( ! -d /usr/spool ) then
  52.     mkdir /usr/spool
  53. endif
  54.    
  55. ${LN} -s ../../var/spool/es /usr/spool/es
  56.    
  57. echo "Done."
  58.