home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / private / etc / rc.common < prev    next >
Encoding:
Text File  |  2001-09-20  |  1.3 KB  |  75 lines

  1. ##
  2. # Common setup for startup scripts.
  3. ##
  4. # Wilfredo Sanchez | wsanchez@opensource.apple.com
  5. # Copyright 1998-2001 Apple Computer, Inc.
  6. ##
  7.  
  8. #######################
  9. # Configure the shell #
  10. #######################
  11.  
  12. ##
  13. # Be strict
  14. ##
  15. #set -e
  16. set -u
  17.  
  18. ##
  19. # Set command search path
  20. ##
  21. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices; export PATH
  22.  
  23. ARCH=$(uname -p)
  24.  
  25. ##
  26. # Set the terminal mode
  27. ##
  28. #if [ -x /usr/bin/tset ] && [ -f /usr/share/misc/termcap ]; then
  29. #    TERM=$(tset - -Q); export TERM
  30. #fi
  31.  
  32. ####################
  33. # Useful functions #
  34. ####################
  35.  
  36. ##
  37. # Print a message to the console and display it in the startup screen
  38. ##
  39. ConsoleMessage()
  40. {
  41.     local Message="$*"
  42.  
  43.     echo "${Message}"
  44. }
  45.  
  46. ##
  47. # Determine if the network is up by looking for any non-loopback
  48. # internet network interfaces.
  49. ##
  50. CheckForNetwork()
  51. {
  52.     local test
  53.  
  54.     if [ -z "${NETWORKUP:=}" ]; then
  55.     test=$(ifconfig -a | sed -e '/127.0.0.1/d' | sed -e '/0.0.0.0/d' | sed -n '/inet/p' | wc -l)
  56.     if [ "${test}" -gt 0 ]; then
  57.         NETWORKUP="-YES-"
  58.     else
  59.         NETWORKUP="-NO-"
  60.     fi
  61.     fi
  62. }
  63.  
  64. ##########################
  65. # Get host configuration #
  66. ##########################
  67. . /etc/hostconfig
  68.  
  69. ##
  70. # Enable coredumps if requested.
  71. ##
  72. if [ "${COREDUMPS:=-NO-}" = "-YES-" ]; then
  73.     ulimit -c unlimited
  74. fi
  75.