Wednesday, July 26, 2017

▷SunOS network info (네트워크 정보)

[ To find network info ]


   SunOS)
      ifconfig -a4 | awk \
         '{if($0 ~ /^[a-z]/)
              print "DEVBLOCK\n"$0;
           else
              print $0;
          } END { print "DEVBLOCK"; }' | awk \
         'BEGIN { i=0; }
          {if($2 ~ /^flags/) { DEV_NAME=$1; i++ }}
          i==0 { next; }
          {if($2 ~ /^flags/ && $0 ~ /STANDBY/) INACT="Y"; }
          {if($1=="inet") { DEV_ADDR=$2; i++ }}
          {if($1=="groupname") { DEV_GRP=$2; }}
          {if($1=="ether") { DEV_MAC=$2; i++ }}
          {if(i==3) {
              printf("%s %s %s %s %s\n", DEV_NAME, DEV_MAC, DEV_ADDR, INACT, DEV_GRP);
              i=0; INACT="N"; DEV_GRP="";
           }
           else if($1=="DEVBLOCK" && i==2) {
              printf("%s %s %s %s %s\n", DEV_NAME, "-", DEV_ADDR, INACT, DEV_GRP);
              i=0; INACT="N"; DEV_GRP="";
           }
          }' | sed -e 's/: / /' | grep -v '^lo'
      ...
      ...
      ;;

No comments:

Post a Comment

◈ Recent Post

▷ UITest demo with TestOne (Mobile, Keypad and Drag until found tip)

[ UITest Demo Environment ] 1. UITest Solution: TestOne 2. Description 데모 설명    How to use keypad, and to drag until found.     키패드를...

◈ Popular Posts