2 ################################################################################
5 # Description: Displays information about a machine
6 # Author: Andrew@DeFaria.com
7 # Created: Fri Apr 30 14:13:56 PDT 1999
10 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
12 ################################################################################
13 # Set me to command name
17 adm_base=${adm_base:-$HOME/adm}
20 adm_fpath=${adm_fpath:-$adm_base/functions}
26 machines=${machines:-$adm_base/data/machines}
28 if [ ! -f $machines ]; then
29 print -u2 "$me: Error: Unable to find $machines file!"
33 function display_machine_info {
37 line=$(grep "^$machine:" $machines 2> /dev/null)
39 if [ "_$line" = "_" ]; then
40 print -u2 "No information on machine $machine"
42 machine=$(print $line | cut -f1 -d:)
43 ip_address=$(print $line | cut -f2 -d:)
44 model=$(print $line | cut -f3 -d:)
45 osversion=$(print $line | cut -f4 -d:)
46 ccversion=$(print $line | cut -f5 -d:)
47 owner=$(print $line | cut -f6 -d:)
48 phone=$(print $line | cut -f7 -d:)
49 usage=$(print $line | cut -f8 -d:)
50 class=$(print $line | cut -f9 -d:)
51 location=$(print $line | cut -f10 -d:)
52 eclipseid=$(print $line | cut -f11 -d:)
53 print "Machine:\t\t$machine"
54 print "IP Address:\t\t$ip_address"
55 print "Model:\t\t\t$model"
56 print "OS Version:\t\t$osversion"
57 print "ClearCase Version:\t$ccversion"
58 print "Owner:\t\t\t$owner" | tr -s "(" "<" | tr -s ")" ">"
59 print "Phone:\t\t\t$phone"
60 print "Usage:\t\t\t$usage"
61 print "Class:\t\t\t$class"
62 print "Location:\t\t$location"
63 print "Eclipse ID:\t\t$eclipseid"
65 } # display_machine_info
67 function dump_all_machines {
68 grep -v "^#" $machines | cut -f1 -d: | while read machine; do
70 --------------------------------------------------------------------------------
71 display_machine_info $machine
75 display_machine_info $(uname -n)
77 if [ "$1" = "-all" ]; then
81 display_machine_info $i