ipranges
ipranges copied to clipboard
Update downloader.sh
Helo my Lord.... I'm trying to contribute to this gem, then I wanna check if PR are welcome just by proposing a simple update for a single downloader, if appreciated I can cover all downloaders quickly :)
List of improvements:
- Dependency check: Ensures curl, dig, jq, and mktemp are installed before proceeding.
- Error handling in downloads: Added retries and error messages for failed downloads.
- Background download: Parallelized downloads for faster execution using & and wait.
- Error handling in dig calls: Added fallback || true to prevent script failure if DNS resolution fails.
- Recursive SPF record resolution: Improved robustness with additional error handling.
- Temp directory with trap: Ensured that the temporary directory is always cleaned up upon script exit.
- Improved sorting: Used sort -u for efficient sorting and deduplication in one step.
- Output directory creation: Ensured the output directory is created before saving the results.
- File size check: Added validation to check if the output files are empty or failed to generate.
- Logging: Enhanced logging for error messages and successful file creations.