home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / usr / template / client / etc / nulib / nu2.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1992-04-10  |  2KB  |  61 lines

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