home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / etherlib / part01 / system < prev   
Encoding:
Text File  |  1989-10-24  |  1.1 KB  |  69 lines

  1. #!/bin/sh
  2. #
  3. # Determine the current system platform
  4. #
  5. if [ -s /bin/arch -a -s /bin/sun ]; then    # Sun's arch
  6.     ARCH=`/bin/arch`
  7.  
  8. elif [ -s /bin/machine ]; then            # MIPS' machine
  9.     ARCH=`/bin/machine`
  10.  
  11. elif [ -f /bin/vax ] && /bin/vax; then
  12.     ARCH=vax
  13.  
  14. elif [ "`echo /bin/hp*`" != '/bin/hp*' ]; then    # HP's way
  15.     { /bin/hp9000s800 && ARCH=hp800; } || \
  16.     { /bin/hp9000s500 && ARCH=hp500; } || \
  17.     { /bin/hp9000s300 && ARCH=hp300; } || \
  18.     { /bin/hp9000s200 && ARCH=hp200; } || \
  19.     { /bin/hp300 && ARCH=hp300; } || \
  20.     { /bin/hp800 && ARCH=hp800; }        # Utah HP 4.3
  21.  
  22. elif [ -d /usr/ibm -o -d /vrm ]; then        # IBM AIX or ACIS
  23.     ARCH=ibmrt
  24.  
  25. elif [ -d /NextLibrary ]; then            # Unique to NeXT cubes
  26.     ARCH=next
  27.  
  28. elif [ -d /usr/ucb ]; then            # desperation time
  29.     ARCH=vax
  30. fi
  31.  
  32. case $ARCH in
  33.  
  34.     hp*)
  35.         if [ -f /hp-ux ]; then
  36.             OS=hpux
  37.         fi;;
  38.  
  39.     ibmrt)
  40.         if [ -d /vrm ]; then
  41.             OS=aix
  42.         fi;;
  43.  
  44.     mips*)
  45.         if [ -f /ultrixboot ]; then
  46.             ARCH=mipsel
  47.             OS=ultrix
  48.         fi;;
  49.  
  50.     sun[234])
  51.         if [ -f /usr/ucb/logger ]; then
  52.             OS=os4
  53.         elif [ -d /usr/suntools ]; then
  54.             OS=os2
  55.         fi;;
  56.  
  57.     next)    OS=mach;;
  58.  
  59.     vax)
  60.         if [ -f /ultrixboot ]; then
  61.             OS=ultrix
  62.         fi;;
  63.  
  64.     *)    ARCH=unknown;;
  65.  
  66. esac
  67.  
  68. exec echo $ARCH${OS+-$OS}
  69.