您好,登錄后才能下訂單哦!
依賴于前文環(huán)境:http://wuyanc.blog.51cto.com/11569260/1855947
對于pxe系統(tǒng)部署而言,網(wǎng)卡mac地址是必須的,而一臺臺手動去獲取也太勞心勞累了,我們可以通過以下腳本批量獲取你所需的mac,速度杠杠的,幾秒鐘的事。
#!/bin/bash # chenss # date : 2016-09-09 # user='root' passwd='calvin' get_nic () { case $2 in 1)racadm -r $1 -u $user -p $passwd getsysinfo -s --nocertwarn | egrep '1-1-1' | awk -v ip="$1" 'BEGIN{FS="="} {print ip"\t""EM1"$2};';; 2)racadm -r $1 -u $user -p $passwd getsysinfo -s --nocertwarn | egrep '1-2-1|2-1-1' | awk -v ip="$1" 'BEGIN{FS="="} {print ip"\t""EM2"$2};';; 3)racadm -r $1 -u $user -p $passwd getsysinfo -s --nocertwarn | egrep '1-3-1|3-1-1' | awk -v ip="$1" 'BEGIN{FS="="} {print ip"\t""EM3"$2};';; 4)racadm -r $1 -u $user -p $passwd getsysinfo -s --nocertwarn | egrep '1-4-1|4-1-1' | awk -v ip="$1" 'BEGIN{FS="="} {print ip"\t""EM4"$2};';; *)racadm -r $1 -u $user -p $passwd getsysinfo -s --nocertwarn | egrep 'Ethernet' | awk -v ip="$1" '{print ip"\t",$0};';; esac } get_nic $1 $2
執(zhí)行結(jié)果:
[root@racadm 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 (10) New server raid、bios init (99) Execute the command manually (*) exit script ######################################################## please option your choice: 1 192.168.1.1 EM1 24:6F:99:46:4D:78 192.168.1.2 EM1 24:6F:99:46:4D:79 192.168.1.3 EM1 24:6F:99:46:4D:80 192.168.1.4 EM1 24:6F:99:46:4D:81 192.168.1.5 EM1 24:6F:99:46:4D:82 192.168.1.6 EM1 24:6F:99:46:4D:83 192.168.1.7 EM1 24:6F:99:46:4D:84 192.168.1.8 EM1 24:6F:99:46:4D:85 192.168.1.9 EM1 24:6F:99:46:4D:86 192.168.1.10 EM1 24:6F:99:46:4D:87 used time : 3s
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。