2
0

feat: gateway部署调整

This commit is contained in:
caiyuchao
2025-04-17 20:58:33 +08:00
parent 637d4da735
commit ddc94e5a5d
3 changed files with 45 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ CPU=""
MB=""
IP=""
MAC=""
CODE=""
# 解析命令行参数
while [[ $# -gt 0 ]]; do
@@ -46,6 +47,10 @@ while [[ $# -gt 0 ]]; do
CPU="$2"
shift 2
;;
-code|--code)
CODE="$2"
shift 2
;;
-mb|--mb)
MB="$2"
shift 2
@@ -72,14 +77,21 @@ echo "ip序列号: $MB"
IP=$(printf "%s\",\"" "${IPS[@]}")
IP=${IP%\",\"}
if [ ! -z "$IP" ]; then
IP=\"$IP\"
fi
MAC=$(printf "%s\",\"" "${MACS[@]}")
MAC=${MAC%\",\"}
if [ ! -z "$MAC" ]; then
MAC=\"$MAC\"
fi
RAW='{
"expiryTime": "'$TIME'",
"ipAddress": ["'$IP'"],
"macAddress": ["'$MAC'"],
"ipAddress": ['$IP'],
"macAddress": ['$MAC'],
"cpuSerial": "'$CPU'",
"activationCode": "'$CODE'",
"mainBoardSerial": "'$MB'"
}'