-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path05-download_alfresco_resources.sh
executable file
·44 lines (33 loc) · 1.32 KB
/
05-download_alfresco_resources.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# URLs of the resources to be downloaded
URLS=(
"https://nexus.alfresco.com/nexus/repository/releases/org/alfresco/alfresco-content-services-community-distribution/23.2.1/alfresco-content-services-community-distribution-23.2.1.zip"
"https://nexus.alfresco.com/nexus/repository/releases/org/alfresco/alfresco-search-services/2.0.9.1/alfresco-search-services-2.0.9.1.zip"
"https://nexus.alfresco.com/nexus/repository/releases/org/alfresco/alfresco-transform-core-aio/5.1.0/alfresco-transform-core-aio-5.1.0.jar"
)
# Directory to save the downloaded files
DOWNLOAD_DIR="./downloads"
# Create the download directory if it does not exist
mkdir -p "$DOWNLOAD_DIR"
# Function to download a file
download_file() {
local url=$1
local dest_dir=$2
local filename=$(basename "$url")
echo "Downloading $filename..."
curl -L -o "$dest_dir/$filename" -w "\nHTTP Status: %{http_code}\n" "$url"
if [ $? -eq 0 ]; then
echo "Downloaded $filename successfully."
else
echo "Failed to download $filename."
fi
# Check if the file size is greater than 0 bytes
if [ ! -s "$dest_dir/$filename" ]; then
echo "Warning: Downloaded file $filename is empty."
fi
}
# Loop through each URL and download the file
for url in "${URLS[@]}"; do
download_file "$url" "$DOWNLOAD_DIR"
done
echo "All downloads are complete."