home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / base / root.15 / sbin / rc3 / rc3~
Text File  |  1998-08-19  |  2KB  |  66 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:common/cmd/initpkg/rc3.sh    1.11.11.11"
  12.  
  13. #    "Run Commands" executed when the system is changing to init state 3,
  14. #    same as state 2 (multi-user) but with distributed file system support.
  15.  
  16. if [ -z "$LC_ALL" -a -z "$LC_MESSAGES" ]
  17. then
  18.     if [ -z "$LANG" ]
  19.     then
  20.         LNG=`defadm locale LANG 2>/dev/null`
  21.         if [ "$?" != 0 ]
  22.         then LANG=C
  23.         else eval $LNG
  24.         fi
  25.     fi
  26.     LC_MESSAGES=/etc/inst/locale/$LANG
  27.     export LANG LC_MESSAGES
  28. fi
  29. LABEL="UX:$0"
  30.  
  31. CAT=uxrc; export CAT
  32.  
  33. set -- `LC_ALL=C /sbin/who -r`
  34. _CURR_RL=$7 _CURR_NTIMES=$8 _PREV_RL=$9 export _CURR_RL _CURR_NTIMES _PREV_RL
  35. case "$_PREV_RL" in
  36. s | S )
  37.     if [ "$_CURR_RL" -eq 3 -a "$_CURR_NTIMES" -eq 0 ]
  38.     then
  39.         _AUTOBOOT=true export _AUTOBOOT
  40.     fi
  41.     ;;
  42. esac
  43.  
  44. cd /etc/rc3.d 2>/dev/null
  45. if [ $? -eq 0 ]
  46. then
  47.     for f in K*
  48.     {
  49.         case $f in
  50.         K\* ) ;;
  51.         * ) /sbin/sh ${f} stop ;;
  52.         esac
  53.     }
  54.     for f in S*
  55.     {
  56.         case $f in
  57.         S\* ) ;;
  58.         * ) /sbin/sh ${f} start ;;
  59.         esac
  60.     }
  61. fi
  62. if [ $_PREV_RL = 'S' -o $_PREV_RL = '1' ]
  63. then
  64.     pfmt -l $LABEL -s info -g $CAT:79 "The system is ready.\n"
  65. fi
  66.