Skip to content

Commit 435888e

Browse files
feat(cicd): Added error handling to the etc-files wordlist pipeline
1 parent fdd59a8 commit 435888e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#!/bin/bash
2+
set -euo pipefail
23

34
# get new package URLs
45
# load the list of amd64 packages from ubuntu
56
export dist="$(cat current_distro)"
67
export repo="http://archive.ubuntu.com/ubuntu"
8+
export url="$repo/dists/$dist/main/binary-amd64/Packages.gz"
79

810
# print URLs
9-
curl $repo/dists/$dist/main/binary-amd64/Packages.gz | \
10-
gzip -d | awk '/^Filename: / { print ENVIRON["repo"] "/" $2 }'
11+
if ! data="$(curl -fsSL "$url")"; then
12+
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
13+
exit 1
14+
fi
15+
16+
printf '%s' "$data" | gzip -d | awk -v repo="$repo" '/^Filename: / { print repo "/" $2 }'

0 commit comments

Comments
 (0)