root/trunk/ports/net/macathena-machtype/files/patch-machtype_linux.sh

Revision 10, 1.6 kB (checked in by broder, 16 years ago)

Created macathena-machtype port. Also, added ncurses as a dependency for moira

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1 --- machtype_linux.sh.orig      2007-12-24 21:51:18.000000000 -0600
2 +++ machtype_linux.sh   2007-12-25 00:20:57.000000000 -0600
3 @@ -1,4 +1,4 @@
4 -#!/bin/sh
5 +#!/bin/bash
6  # $Id: machtype_linux.sh,v 1.9 2003/08/12 21:47:50 jweiss Exp $
7  
8  # We need to support the following options:
9 @@ -86,7 +86,7 @@
10  fi
11  
12  if [ $syspacks ]; then
13 -       echo "Linux does not use system packs." >&2
14 +       echo "MacAthena does not use system packs." >&2
15         printed=1
16  fi
17  
18 @@ -133,32 +133,31 @@
19  fi
20  
21  if [ $display ] ; then
22 -        /sbin/lspci | awk -F: '/VGA/ {print $3}' | sed -n -e 's/^ //' -e p
23 +       system_profiler SPDisplaysDataType | awk 'NR==3 { print }' | sed "s/^ *\(.*\):$/\1/"
24         printed=1
25  fi
26  
27  if [ $rdsk ]; then
28 -       awk '/^SCSI device/ { print; }
29 -            /^hd[a-z]:/ { print; }
30 -            /^Floppy/ { for (i=3; i <= NF; i += 3) print $i ": " $(i+2); }' \
31 -            /var/log/dmesg
32 +       disks=`ls /dev/disk* | grep 'disk[0-9]*$'`
33 +       for disk in $disks
34 +       do
35 +               printf "%s: %s GB\n" "$(basename $disk)" "$(diskutil info "$disk" | awk '$1=="Total" { print  $3 }')"
36 +       done
37         printed=1
38  fi
39  
40  if [ $memory ] ; then
41 +       physmem=$(($(sysctl -n hw.physmem)/1024))
42 +       usermem=$(($(sysctl -n hw.usermem)/1024))
43         if [ $verbose ]; then
44 -               awk 'BEGIN { FS="[^0-9]+" }
45 -                    /^Memory:/ { printf "user=%d, phys=%d (%d M)\n",
46 -                                        $2*1.024, $3*1.024, $3/1000; }' \
47 -                   /var/log/dmesg
48 +               printf "user=%d, phys=%d (%d M)\n" $usermem $physmem $((physmem/1024))
49         else
50 -               awk 'BEGIN { FS="[^0-9]+" }
51 -                    /^Memory:/ { printf "%d\n", $3*1.024; }' /var/log/dmesg
52 +               echo $physmem
53         fi
54         printed=1
55  fi
56  
57  if [ $printed -eq '0' ] ; then
58 -       echo linux
59 +       echo darwin
60  fi
61  exit 0
Note: See TracBrowser for help on using the browser.