Add Curl back to api
This commit is contained in:
parent
9d86f0f2d8
commit
18a2726dfc
@ -16,7 +16,7 @@ post_to_api() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local API_URL="http://api.community-scripts.org/upload"
|
local API_URL="http://api.community-scripts.org/dev/upload"
|
||||||
local pve_version="not found"
|
local pve_version="not found"
|
||||||
pve_version=$(pveversion | awk -F'[/ ]' '{print $2}')
|
pve_version=$(pveversion | awk -F'[/ ]' '{print $2}')
|
||||||
|
|
||||||
@ -39,6 +39,10 @@ post_to_api() {
|
|||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$JSON_PAYLOAD") || true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
post_to_api_vm() {
|
post_to_api_vm() {
|
||||||
@ -59,7 +63,7 @@ post_to_api_vm() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local API_URL="http://api.community-scripts.org/upload"
|
local API_URL="http://api.community-scripts.org/dev/upload"
|
||||||
local pve_version="not found"
|
local pve_version="not found"
|
||||||
pve_version=$(pveversion | awk -F'[/ ]' '{print $2}')
|
pve_version=$(pveversion | awk -F'[/ ]' '{print $2}')
|
||||||
|
|
||||||
@ -84,6 +88,10 @@ post_to_api_vm() {
|
|||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$JSON_PAYLOAD") || true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
POST_UPDATE_DONE=false
|
POST_UPDATE_DONE=false
|
||||||
@ -96,7 +104,7 @@ post_update_to_api() {
|
|||||||
if [ "$POST_UPDATE_DONE" = true ]; then
|
if [ "$POST_UPDATE_DONE" = true ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
local API_URL="http://api.community-scripts.org/upload/updatestatus"
|
local API_URL="http://api.community-scripts.org/dev/upload/updatestatus"
|
||||||
local status="${1:-failed}"
|
local status="${1:-failed}"
|
||||||
local error="${2:-No error message}"
|
local error="${2:-No error message}"
|
||||||
|
|
||||||
@ -108,7 +116,9 @@ post_update_to_api() {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$JSON_PAYLOAD") || true
|
||||||
|
|
||||||
POST_UPDATE_DONE=true
|
POST_UPDATE_DONE=true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user