home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / base / root.15 / sbin / dinit / dinit~
Text File  |  1998-08-19  |  2KB  |  72 lines

  1. #!/sbin/sh
  2.  
  3. # Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  4. #                                                                         
  5. #        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  6. #                   SANTA CRUZ OPERATION INC.                             
  7. #                                                                         
  8. #   The copyright notice above does not evidence any actual or intended   
  9. #   publication of such source code.                                      
  10.  
  11. #ident    "@(#)initpkg:i386/cmd/initpkg/dinit.sh    1.2.1.7"
  12.  
  13. #     Startup scripts that can be delayed to be run after login
  14. #    processes have been started. Should run fast!
  15.  
  16. #INFO messages should not appear in screen, save them in /var/adm/dinit.log
  17. exec >/var/adm/dinit.log
  18. chmod 664 /var/adm/dinit.log
  19.  
  20. if [ -z "$LC_ALL" -a -z "$LC_MESSAGES" ]
  21. then
  22.     if [ -z "$LANG" ]
  23.     then
  24.         LNG=`defadm locale LANG 2>/dev/null`
  25.         if [ "$?" != 0 ]
  26.         then LANG=C
  27.         else eval $LNG
  28.         fi
  29.     fi
  30.     LC_MESSAGES=/etc/inst/locale/$LANG
  31.     export LANG LC_MESSAGES
  32. fi
  33. LABEL="UX:$0"
  34.  
  35. CAT=uxrc; export CAT
  36.  
  37. set -- `LC_ALL=C /sbin/who -r`
  38. _CURR_RL=$7 _CURR_NTIMES=$8 _PREV_RL=$9 export _CURR_RL _CURR_NTIMES _PREV_RL
  39. unset _AUTOBOOT _AUTOKILL _AUTOUMOUNT
  40. case "$_PREV_RL" in
  41. s | S )
  42.     case "$_CURR_RL" in
  43.     2 | 3 )
  44.         if [ "$_CURR_NTIMES" -eq 0 ]
  45.         then
  46.             _AUTOBOOT=true export _AUTOBOOT
  47.         fi
  48.         ;;
  49.     esac
  50.     :
  51.     cd /etc/dinit.d 2>/dev/null
  52.     if [ $? -eq 0 ]
  53.     then
  54.         for f in K*
  55.         {
  56.             case $f in
  57.             K\* ) ;;
  58.             * ) /sbin/sh ${f} stop ;;
  59.             esac
  60.         }
  61.  
  62.         for f in S*
  63.         {
  64.             case $f in
  65.             S\* ) ;;
  66.             * ) /sbin/sh ${f} start ;;
  67.             esac
  68.         }
  69.     fi
  70.     ;;
  71. esac
  72.