Show operating system, current user & network

I have found an excellent OS X pref pane that allows you to output log files or terminal commands/scripts onto the desktop in the background.

What I want to do is create a script that outputs the following...

  • Mac OS X Version and Build (As shown in the about this mac)
  • Current username
  • Current network ports and their associated IP addresses.
  • Current machine or hostname
  • Attached Volumes

So an example output would be

Mac OS X 10.5.5 Build 9F33
JonDoe
en0 192.168.0.1
en1 192.168.0.2
computer.local <or> computer.mydomain.com
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *111.8 Gi disk0
1: EFI 200.0 Mi disk0s1
2: Apple_HFS Macintosh HD 88.9 Gi disk0s2
3: Microsoft Basic Data WINDOWS 22.6 Gi disk0s3

Could someone help or point me at the right commands and how to output it.

I know diskutil will show me the volumes etc but the rest I am unsure of.

Thanks in advance

so far I am thinking I need to run these commands....

id
ifconfig
hostname
uptime
networksetup -listallnetworkservices
diskutil list
softwareupdate -l

But I want to output them all on screen at once, do i need to pipe? them? also is there any way of either condensing the ifconfig output to just show device and ip or is there another command?

You might want to consider using just
df
instead of
diskutil list

df is a lot faster

Edit: Also, id producea a lot more output than you're looking for, whoami seem to fit the bill better.

You definately do not want to pipe these commands together, piping means sending the output of a command to another which would not be what you want.

What is the pref pane you're talking about?
Link to it and maybe I can take a stab at it.

What version of OS X and would this script be ran on the client OS or a server OS?

This can be done via ARD admin of course.

looks like he's talking about "geektool" pref pane.

various geektool related tutorials on lifehacker maybe of help.

yes thats right many thanks for your replies.

you also may want to look into the system_profiler command