NextWeb/dev/exec.sh

34 lines
910 B
Bash
Raw Permalink Normal View History

2024-11-02 12:20:31 +07:00
#!/bin/bash
2024-11-02 12:28:05 +07:00
2024-11-02 12:20:31 +07:00
# Create a temporary file to store the URLs
temp_file=$(mktemp)
# Extract URLs from the link.txt file
2024-11-02 12:29:29 +07:00
grep -o 'https://apps-assets.fit2cloud.com/dev/1panel/.*' logo.txt > "$temp_file"
2024-11-02 12:20:31 +07:00
# Create a directory to store the downloaded files
2024-11-02 12:28:05 +07:00
mkdir -p nextweb
2024-11-02 12:20:31 +07:00
# Change to the downloads directory
cd nextweb
# Read each URL from the temporary file
while IFS= read -r url; do
# Extract the path after the base URL
path=$(echo "$url" | sed 's|https://apps-assets.fit2cloud.com/dev/1panel/||')
2024-11-02 12:28:05 +07:00
# Create the directory structure if it doesn't exist
if [ ! -d "$(dirname "$path")" ]; then
mkdir -p "$(dirname "$path")"
fi
2024-11-02 12:20:31 +07:00
# Download the file
2024-11-02 12:28:05 +07:00
filename=$(basename "$url")
wget -q "$url" -O "$filename"
# Move the file to the appropriate directory
mv "$filename" "$(dirname "$path")"
2024-11-02 12:20:31 +07:00
done < "$temp_file"
# Remove the temporary file
rm "$temp_file"