home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / usr / template / client / etc / nulib / nu2.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1992-03-20  |  1.6 KB  |  60 lines

  1. #! /bin/csh #31# This shell script is called from nu to initialize the contents of a
  2. # newly-created user's directory.
  3. #
  4. # it is named "nu2.sh" instead of something like "addfiles.sh" to discourage
  5. # people from trying to run it standalone, without going through nu.
  6. #
  7. # Created:  25 Aug 84    Brian Reid
  8.  
  9. set logindir=$1
  10. set uid=$2
  11. set gid=$3
  12. set wantMHsetup=$4
  13. set debug=$5
  14. set language=$6
  15. set noglob; set path=(/etc /usr/etc $path); unset noglob
  16. if ( $debug != 0 ) then
  17.     set verbose
  18. endif
  19. cd $logindir
  20. if ( $6 != "Japanese") then
  21.     if ( -d /usr/template/user ) then
  22.         foreach i (/usr/template/user/.[a-zA-Z]* /usr/template/user/*)
  23.         if ( $i != /usr/template/user/Mail ) then
  24.             cp -rp $i .
  25.         endif
  26.         end
  27.     endif
  28. else
  29.     if ( -d /usr/template/user.Japanese ) then
  30.         foreach i (/usr/template/user.Japanese/.[a-zA-Z]* /usr/template/user.Japanese/*)
  31.         if ( $i != /usr/template/user.Japanese/Mail ) then
  32.             cp -rp $i .
  33.         endif
  34.         end
  35.     endif
  36. endif
  37.  
  38. if ( $debug == 0 ) then
  39.     set files = `find . -print`
  40.     chown $uid .[a-zA-Z]* $files
  41.     chgrp $gid .[a-zA-Z]* $files
  42. endif
  43.  
  44. if ($wantMHsetup) then
  45.     mkdir Mail
  46.     mkdir Mail/inbox
  47.     if ( $6 != "Japanese") then
  48.         if ( -d /usr/template/user/Mail/inbox ) then
  49.         cp /usr/template/user/Mail/inbox/* Mail/inbox
  50.         endif
  51.     else
  52.         if ( -d /usr/template/user.Japanese/Mail/inbox ) then
  53.         cp /usr/template/user.Japanese/Mail/inbox/* Mail/inbox
  54.         endif
  55.     endif
  56.     if ($debug == 0) chown $uid Mail Mail/* Mail/inbox/*
  57.     if ($debug == 0) chgrp $gid Mail Mail/* Mail/inbox/*
  58.     chmod 0711 Mail
  59. endif
  60.