home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / usr / template / client / etc / nulib / nu1.sh next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1992-03-20  |  1023 b   |  39 lines

  1. #! /bin/csh -fb
  2. # This shell script is called from /etc/nu to create a new directory for a
  3. # new user, and to make the necessary links and permissions for it.
  4. # it is named "nu1.sh" instead of something like "makeuser.sh" to discourage
  5. # people from trying to run it standalone, without going through nu.
  6.  
  7. set uid#32set gid=$2
  8. set logindir=$3
  9. set linkdir=$4
  10. set clobber=$5
  11. set debug=$6
  12. set username=$7
  13. set langauge=$8
  14. set noglob; set path=(/etc /usr/etc $path); unset noglob
  15. if ( $debug != 0 ) then
  16.     set verbose
  17. endif
  18. if ($clobber) then
  19.     rm -rf $logindir
  20.     mkdir $logindir
  21. endif
  22. if ("$logindir" != "$linkdir") then
  23.     ln -s $logindir $linkdir
  24.     chown $uid $linkdir
  25.     chgrp $gid $linkdir
  26. endif
  27. if (($debug == 0) && $clobber) chown $uid $logindir
  28. if (($debug == 0) && $clobber) chgrp $gid $logindir
  29.  
  30. # Mail to root that a new user was created....
  31. if ($debug == 0) then
  32.     mail -s "Welcome new user $username:t" root  << xxMAILxx
  33.     The new user "$username:t" was added by $user.
  34.  
  35.     The Nu Program.
  36. xxMAILxx
  37. endif
  38.