Apple Resources - Terminal Script About
http://edu-observatory.org/olli/Apple_Resources/Terminal-Script-About.html



#!/bin/csh
#About

  clear -x
  echo ""
  echo ""
  echo -n "      Whoami: "; whoami
  if (-e /Users) then
    echo -n "      Device: "; echo -n $HOST "(`ioreg -r -k AppleClamshellState -d 4 | grep AppleClamshellState | cut -c31-34 | sed s.No.open.g | sed s.Yes.closed.`)"; echo ""
    echo -n "      Charge:"; system_profiler SPPowerDataType  | grep -A0 "Connected" | sed s."     Connected: "..g
  endif
  echo -n "      `curl --connect-timeout 1 -s ipinfo.io/org | cut -d ' ' -f1` `curl --connect-timeout 1 -s icanhazip.com`"
  echo ""
  echo ""

  echo "   Hardware"
  system_profiler SPHardwareDataType | grep -B8 -A4 'Serial Number (system):'
  echo "   Software"
  system_profiler SPSoftwareDataType SPInstallHistoryDataType | grep -A9 'System Version'
  
  echo "   Network"
  if (`ipconfig getifaddr en6` != "") then
    echo "      Intereface: en6"
    set arg6 = `ipconfig getifaddr en6`
    echo "      `ipconfig getifaddr en6` <==> `dig -b $arg6 -4 -t a    +short myip.opendns.com @resolver1.opendns.com`"
    echo "      `ifconfig en6 | grep 'inet6 2' | grep '64 autoconf secured'   | cut -d ' ' -f2,6`"
    echo "      `ifconfig en6 | grep 'inet6 2' | grep '64 autoconf temporary' | cut -d ' ' -f2,6`"
  endif
  
  
  if (`ipconfig getifaddr en0` != "") then
    echo ""; echo "      Intereface: en0   (`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep ' SSID' | cut -c12-40`)"
    set arg0 = `ipconfig getifaddr en0`
    echo "      `ipconfig getifaddr en0` <==> `dig -b $arg0 -4 -t a    +short myip.opendns.com @resolver1.opendns.com`"
    echo "      `ifconfig en0 | grep 'inet6 2' | grep '64 autoconf secured'   | cut -d ' ' -f2,6`"
    echo "      `ifconfig en0 | grep 'inet6 2' | grep '64 autoconf temporary' | cut -d ' ' -f2,6`"
  endif
  echo ""


  
  
  

 
    sam.wormley@gmail.com