Solaris LDOM

From Lolly's Wiki
Revision as of 13:29, 12 February 2015 by Lollypop (talk | contribs) (Die Seite wurde neu angelegt: „Kategorie:LDOM Kategorie:Solaris <source lang=bash> #!/bin/bash link=$1 dev=$(dladm show-phys -L ${link} | \ nawk ' NR==2{ dev=$2; gsub(/[0-9]+$/,…“)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Kategorie:LDOM Kategorie:Solaris

#!/bin/bash
link=$1
dev=$(dladm show-phys -L ${link} | \
  nawk '
NR==2{
  dev=$2; gsub(/[0-9]+$/,"",dev);
  instance=$2; gsub(/^[^0-9]*/,"",instance);
  while(getline < "/etc/path_to_inst"){
    gsub(/"/,"",$NF);
    if($NF == dev && $(NF-1) == instance){
      gsub(/"/,"",$1);
      gsub(/^\//,"",$1);
      print $1;
    }
  }
}
')
ldm ls-io -l ${dev}