Skip to content

Commit 4ff6533

Browse files
authored
Create delete_files.sh
Created
1 parent 27fe427 commit 4ff6533

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Base URL of the API
4+
BASE_URL="https://eoagritool-cwfzfndaazauawex.canadacentral-01.azurewebsites.net"
5+
6+
# Endpoint for deleting extensions
7+
DELETE_ENDPOINT="/api/delete_extension"
8+
9+
# Function to delete files
10+
delete_files() {
11+
# Make a DELETE request to the API endpoint
12+
response=$(curl -X DELETE "$BASE_URL$DELETE_ENDPOINT" -w "%{http_code}" -o /dev/null -s)
13+
14+
# Check the HTTP response code
15+
if [ "$response" -eq 200 ]; then
16+
echo "Files deleted successfully."
17+
else
18+
echo "Failed to delete files. HTTP response code: $response"
19+
fi
20+
}
21+
22+
# Call the function to delete files
23+
delete_files

0 commit comments

Comments
 (0)