mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-06 07:49:17 +00:00
Update build.func
This commit is contained in:
parent
38a540b87a
commit
00cd62fc38
@ -813,6 +813,36 @@ advanced_settings() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_to_api() {
|
||||||
|
local API_URL="http://api.htl-braunau.at/upload"
|
||||||
|
|
||||||
|
|
||||||
|
JSON_PAYLOAD=$(cat <<EOF
|
||||||
|
{
|
||||||
|
"ct_type": $CT_TYPE,
|
||||||
|
"disk_size": $DISK_SIZE,
|
||||||
|
"core_count": $CORE_COUNT,
|
||||||
|
"ram_size": $RAM_SIZE,
|
||||||
|
"verbose": "$VERBOSE",
|
||||||
|
"ct_id": $CT_ID,
|
||||||
|
"hn": "$HN",
|
||||||
|
"disableip6": "$DISABLEIP6",
|
||||||
|
"ssh": "$SSH",
|
||||||
|
"tags": "$TAGS",
|
||||||
|
"nsapp": "$NSAPP"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s -o response.txt -w "%{http_code}" -X POST "$API_URL" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$JSON_PAYLOAD")
|
||||||
|
|
||||||
|
if [ ! "$RESPONSE" -eq 201 ]; then
|
||||||
|
msg_error "API request failed with HTTP code $RESPONSE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
install_script() {
|
install_script() {
|
||||||
pve_check
|
pve_check
|
||||||
shell_check
|
shell_check
|
||||||
@ -942,7 +972,7 @@ build_container() {
|
|||||||
else
|
else
|
||||||
FEATURES="nesting=1"
|
FEATURES="nesting=1"
|
||||||
fi
|
fi
|
||||||
|
post_to_api
|
||||||
|
|
||||||
TEMP_DIR=$(mktemp -d)
|
TEMP_DIR=$(mktemp -d)
|
||||||
pushd $TEMP_DIR >/dev/null
|
pushd $TEMP_DIR >/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user