feat(cicd): Added error handling to the etc-files wordlist pipeline

This commit is contained in:
ItsIgnacioPortal 2026-03-06 21:27:53 -03:00
parent fdd59a8ee1
commit 435888e884
No known key found for this signature in database
GPG key ID: 8A401781634614F8

View file

@ -1,10 +1,16 @@
#!/bin/bash
set -euo pipefail
# get new package URLs
# load the list of amd64 packages from ubuntu
export dist="$(cat current_distro)"
export repo="http://archive.ubuntu.com/ubuntu"
export url="$repo/dists/$dist/main/binary-amd64/Packages.gz"
# print URLs
curl $repo/dists/$dist/main/binary-amd64/Packages.gz | \
gzip -d | awk '/^Filename: / { print ENVIRON["repo"] "/" $2 }'
if ! data="$(curl -fsSL "$url")"; then
echo "[ERROR] The download of package lists from Ubuntu failed. The URL was: \"$url\". Either the server is down, or it's time to update the distro name in this file: \"SecLists/.bin/etc-files-list-update/current_distro\"" >&2
exit 1
fi
printf '%s' "$data" | gzip -d | awk -v repo="$repo" '/^Filename: / { print repo "/" $2 }'