#!ipxe
echo 
echo =   Copyright © 2018 SHENGYUN NETWORK TECHNIQUE Co., LTD. All rights reserved.   =
echo
echo UUID ${smbios/uuid}
isset ${root-path} && echo RootPath ${root-path} ||
iseq ${chip} i219v-2 && chain efi/INTEL.EFI ||
iseq ${chip} rtl8168 && chain efi/RtkUndiDxe.efi ||
set ${ifname}/keep-san 1
set ${ifname}/gateway 0.0.0.0
set ${ifname}/initiator-iqn i.H:${mac:hexhyp}
set ${ifname}/san-retries 2
set ${ifname}/mtu 4074
set SI 192.168.8.78
set SD 192.168.8.78
echo INITIATOR ${initiator-iqn}
:PMS
prompt --key s --timeout 1600 Press S to Input Main NAS Slot Number && goto IDS ||
:PMD
prompt --key d --timeout 1600 Press D to Input Additional NAS Slot Number && goto IDD ||
:MA
isset ${NASN} || inc NASN
iseq ${NASN} 4 && goto NS || goto DD
:IDS
echo -n INPUT Main NAS Slot Number.: && read NASN
goto PMD
:IDD
echo -n INPUT SECOND NAS SLOT NO.: && read NADN
:DD
echo Connect via ${chip} to SAN SLOT ${NASN} With ${${ifname}/mtu} MTU
sanhook --drive 0x82 iscsi:${SD}::::t.h01:d${NASN} && echo Attched Data SLOT ${NASN} || set STB 1
isset ${NADN} && sanhook --drive 0x83 iscsi:${SD}::::t.h01:d${NADN} && echo Attched Additional Data SLOT ${NADN} || ||
:SD
sanhook --drive 0x81 iscsi:${SI}::::t.h01:s${NASN} || goto MA
isset ${STB} && sanboot --drive 0x81 || sanboot --drive 0x81 -f \EFI\Microsoft\Boot\bootmgfw.efi
:NS
prompt --key r --timeout 9600 Not found OS on Disk0 in SLOT ${NASN},REBOOT After 60 Seconds... or Press R && reboot || reboot