+set_mac() +{
- job_id=$(cat ipxe_script|awk -F'/' '/job_initrd_tmpfs/{print $(NF-1)}')
awk can directly read the file, better not add a extral step with 'cat file': job_id=$(awk -F'/' '/job_initrd_tmpfs/{print $(NF-1)}' ipxe_script)
Thanks, Luan Shengde
- if [ $(command -v es-find) ]; then
nr_nic=$(es-find id=$job_id | awk '/nr_nic/{print $2}' | tr -d ,)
- else
echo "command not found: es-find. set nr_nic=1"
sleep 1
- fi