Last active
July 21, 2022 23:31
-
-
Save nothub/339cff5283dfa29dd543e557884d10b4 to your computer and use it in GitHub Desktop.
download and unpack phrack issues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -exuo pipefail | |
latest_issue="70" | |
curl \ | |
--location \ | |
--remote-name \ | |
--progress-bar \ | |
--retry 10 \ | |
--retry-delay 60 \ | |
--retry-connrefused \ | |
--continue-at - \ | |
http://www.phrack.org/archives/tgz/phrack[1-${latest_issue}].tar.gz | |
for path in "${PWD}"/*; do | |
file=$(basename "${path}") | |
if ! echo "${file}" | grep --quiet --extended-regexp "phrack[0-9]+\.tar\.gz"; then continue; fi | |
dir="issues/${file//[^0-9]/}" | |
mkdir -p "${dir}" | |
tar xvf "${file}" --directory "${dir}" | |
rm -f "${file}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment