RACADM Environment server Nic Mac get (ii)

Source: Internet
Author: User
Tags egrep

Dependent on the previous context: http://wuyanc.blog.51cto.com/11569260/1855947

For PXE system deployment, the network card MAC address is required, and a manual to get it too tired, we can use the following script in bulk to get the Mac you need, speed, a few seconds.

#!/bin/bash# chenss# date : 2016-09-09#user= ' root ' passwd= ' Calvin ' get_nic  ()  { case $2 in1) racadm -r $1 -u  $user  -p  $passwd   getsysinfo  -s --nocertwarn | egrep  ' 1-1-1 '  | awk -v ip= "$"   ' begin{fs= "="} {print ip "\ T" "EM1" "$"; 2) racadm -r $1 -u  $user  -p  $passwd   getsysinfo -s -- nocertwarn | egrep  ' 1-2-1|2-1-1 '  | awk -v ip= ' $ '   ' BEGIN{FS= ' = '}  {PRINT IP "\ T" "EM2" "$"; 3) racadm -r $1 -u  $user  -p  $passwd   getsysinfo -s -- nocertwarn | egrep  ' 1-3-1|3-1-1 '  | awk -v ip= ' $ '   ' BEGIN{FS= ' = '}  {PRINT IP "\ T" "EM3" "$"; 4) racadm -r $1 -u  $user  -p  $passwd   getsysinfo -s -- nocertwarn | egrep  ' 1-4-1|4-1-1 ' &nbsP;| awk -v ip= "$"   ' begin{fs= "="} {print ip "\ T" "EM4" $ "; *) racadm -r $1 -u  $user  -p  $passwd   getsysinfo -s -- nocertwarn | egrep  ' Ethernet '  | awk -v ip= ' $ '   ' {print ip ' \ t ', $} ;‘;; Esac}get_nic $1 $2


Execution Result:

[[Email protected] idrac]# sh run.sh ########## please option your  choice: [1-10] ############ (1)   get server nic mac-address (2)    Remove all or the virtual disk other than the system  Disk (3)   physical disk mode convert (4)   Create raid1 or  RAID5 (5)   Add idrac user  (TEST)  and change root passwd (6)    bios disable f1/f2 errot prompt and setup hdd first boot (7)   CHECK SYSTEM BOOT SEQ (8)   Restore the root default  Password (9)   reboot system ( new server raid), Bios init (©)  Execute  the command manually (*)  exit script################################################# ###### #please  OPTION&Nbsp;your choice: 1192.168.1.1     em1 24:6f:99:46:4d:78192.168.1.2      EM1 24:6F:99:46:4D:79192.168.1.3     EM1  24:6f:99:46:4d:80192.168.1.4     em1 24:6f:99:46:4d:81192.168.1.5      em1 24:6f:99:46:4d:82192.168.1.6     em1 24:6f:99:46:4d :83192.168.1.7     em1 24:6f:99:46:4d:84192.168.1.8      em1 24:6f:99:46:4d:85192.168.1.9     em1 24:6f:99:46:4d : 86192.168.1.10    em1 24:6f:99:46:4d:87used time : 3s


This article is from the "My Words" blog, please be sure to keep this source http://wuyanc.blog.51cto.com/11569260/1940019

RACADM Environment server Nic Mac get (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.