home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 August - Disc 1 / PCNET_CD_2006_08_1.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / sbin / hardware-probe < prev    next >
Encoding:
Text File  |  2005-03-22  |  1.3 KB  |  42 lines

  1. #!/bin/sh
  2. #BK hardware probe 2003
  3. #Thanks to Antonio Gallo, badpenguin.org, for the libhardware.
  4.  
  5. #note, "> out.txt 2>&1" is syntax required to redirect both stdout and
  6. #stderr to a file, using BusyBox Ash shell.
  7.  
  8. echo "Press a button to probe the hardware of your PC." > /tmp/hardprobe.txt
  9. echo "Note: this is information only, nothing is changed." >> /tmp/hardprobe.txt
  10. echo    "Query-PCI:  Lists all interfaces on PCI bus" >> /tmp/hardprobe.txt
  11. echo    "Drives:     Finds all the drives" >> /tmp/hardprobe.txt
  12. echo    "Partitions: Finds all the partitions and devices" >> /tmp/hardprobe.txt
  13. echo    "Modules:    Detect modules in database" >> /tmp/hardprobe.txt
  14. echo -n "HELP:       Help on how to use this information" >> /tmp/hardprobe.txt
  15.  
  16. while :; do
  17. xmessage -bg "#ffc0c0" -center -name "xutilities" -title "Puppy hardware probe" -buttons \
  18.  "Query-PCI":10,"Drives":11,"Partitions":12,"Modules":13,"HELP":14,"EXIT":15 \
  19.  -file /tmp/hardprobe.txt
  20.  
  21. case ${?} in
  22.    10)# Query-PCI
  23.      test-pci > /tmp/hardprobe.txt 2>&1
  24.      ;;
  25.    11)# Drives
  26.      probedisk > /tmp/hardprobe.txt 2>&1
  27.      ;;
  28.    12)# Partitions
  29.      probepart -k > /tmp/hardprobe.txt 2>&1
  30.      ;;
  31.    13)# Modules
  32.      scanmodule > /tmp/hardprobe.txt 2>&1
  33.      ;;
  34.    14)# HELP
  35.      dillo /usr/share/doc/HOWTO-modules.htm &
  36.      ;;
  37.    15)# = exit
  38.      break;;
  39. esac
  40. done
  41. rm -f /tmp/hardprobe.txt
  42.