Search

Ver.1

# LEO leo_hostname=`cut -f 2 -d '-' /etc/hostname` leo_ip=`hostname -I | grep -e ^1 | awk '{print $1}'` # AGX agx1_ip=`ip addr show | grep usb | grep inet | awk '{print $2}' | cut -c 1-12 | head -1` agx2_ip=`ip addr show | grep usb | grep inet | awk '{print $2}' | cut -c 1-12 | head -2 | tail -1`
Bash
{ "name": "EdgeAiBox"(static), "serial": ${leo_hostname}, "config": { "address": ${leo_ip}, "extra": [ {"name":"GPU1", "status":0}, {"name":"GPU2", "status":1, "address":$agx1_ip}, {"name":"GPU3", "status":0}, {"name":"GPU4", "status":1, "address":$agx2_ip} ] } }
JSON