home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / Other / Coherent / base / disk1.4.10.dd / etc / .profile next >
Encoding:
Text File  |  1994-03-23  |  1.7 KB  |  78 lines

  1. # /etc/.profile original 08/11/93 by Udo Munk (udo@umunk.GUN.de)
  2.  
  3. # Mods at MWC
  4. # Tue Nov  9 09:25:08 1993 CST
  5. # COHERENT executes this profile for the single user shell.
  6.  
  7. # ----- DO NOT CHANGE THE FOLLOWING SECTION FOR SINGLE USER PROFILE -----
  8.  
  9. #
  10. # don't let user abort the shutdown now
  11. #
  12. trap "" 1 2 3
  13.  
  14. # unmount any mounted file systems other than root.
  15. /etc/umount.all || {
  16.     echo "Warning from /etc/.profile: Some non-root file systems remain mounted."
  17.     echo -n "Hit <Enter> to continue shutdown: "
  18.     read junk
  19. }
  20.  
  21.  
  22. #
  23. # let's see, do we want to halt or reboot the system?
  24. #
  25. if [ -f /etc/shutdown.lvl ]; then
  26.   mode=`cat /etc/shutdown.lvl`
  27.   /bin/rm /etc/shutdown.lvl
  28.  
  29.   case $mode in
  30.  
  31.     powerfail)
  32.       /bin/sync
  33.       /bin/sync
  34.       /bin/echo "Power fail, system is safe now."
  35.       #
  36.       # Here you're supposed to call a program which asks the power fail
  37.       # device about the power and returns when and if the line is OK again.
  38.       #
  39.       # Then we may return to multi user. For test purposes,
  40.       # we just read the keyboard instead and when a newline is
  41.       # typed, the power is OK and we take the system back to
  42.       # multi user mode.
  43.       #
  44.       read a
  45.       kill -9 $$
  46.       ;;
  47.  
  48.     halt)
  49.       /bin/sync
  50.       /bin/sleep 5
  51.       echo "System is safe now, switch power off."
  52.       /bin/sync
  53.       /bin/sleep 100000000 
  54.       ;;
  55.  
  56.     reboot)
  57.       /bin/sync
  58.       /bin/sleep 5
  59.       /bin/sync
  60.       /etc/reboot
  61.       ;;
  62.   esac
  63. fi
  64.  
  65. #
  66. # single user mode, allow interrupts again
  67. #
  68. trap 1 2 3
  69.  
  70. # ----- THE FOLLOWING SECTION MAY BE CHANGED FOR SINGLE USER PROFILE -----
  71.  
  72. #
  73. # profile for single user mode
  74. #
  75. export PATH=:/bin:/usr/bin:/etc
  76. export TERM=ansipc
  77. /bin/stty sane
  78.