# Copyright (c) 2021-2025 community-scripts ORG # Author: michelroegl-brunner # License: MIT | https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/LICENSE post_to_api() { echo -e "Posting to API..." if ! command -v curl &>/dev/null; then return fi if [ "$DIAGNOSTICS" = "no" ]; then return fi if [ -z "$RANDOM_UUID" ]; then return fi local API_URL="http://api.community-scripts.org/dev/upload" local pve_version="not found" pve_version=$(pveversion | awk -F'[/ ]' '{print $2}') JSON_PAYLOAD=$( cat </dev/null; then return fi if [ "$POST_UPDATE_DONE" = true ]; then return 0 fi local status="${1:-failed}" if [[ "$status" == "failed" ]]; then local exit_code="${2:-1}" elif [[ "$status" == "success" ]]; then local exit_code="${2:-0}" fi local API_URL="http://api.community-scripts.org/dev/upload/updatestatus" error=$(get_error_description "$exit_code") if [ -z "$error" ]; then error="Unknown error" fi JSON_PAYLOAD=$( cat <