summaryrefslogtreecommitdiff
path: root/download-phrack-targz.sh
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-05-21 19:02:07 +0300
committerheqnx <root@heqnx.com>2025-05-21 19:02:07 +0300
commitccf66306295f306e587c0f5b70aa1309929039b5 (patch)
tree74fedba81bdc767ca92570e145920d9baee8b059 /download-phrack-targz.sh
parent0874699e363adbbafc457d90cc58906b1a591a06 (diff)
downloadphrack-papers-main.tar.gz
phrack-papers-main.zip
added first 71 releasesHEADmain
Diffstat (limited to 'download-phrack-targz.sh')
-rwxr-xr-xdownload-phrack-targz.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/download-phrack-targz.sh b/download-phrack-targz.sh
new file mode 100755
index 0000000..6ec9c01
--- /dev/null
+++ b/download-phrack-targz.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+if ! command -v curl &>/dev/null; then
+ printf "%s\n" "[err] curl not found"
+ exit 1
+fi
+
+archives=$(curl -sSLf https://archives.phrack.org/tgz/ | grep -oP '(?<=phrack)[0-9]{1,}(?=\.tar\.gz)' | sort -n | tail -1)
+
+if ! test "${archives}"; then
+ printf "%s\n" "[err] failed to get phrack archives"
+ exit 1
+fi
+
+for ((i=1; i<=archives; i++)); do
+ remote_file="phrack${i}.tar.gz"
+ if (( i < 10 )); then
+ local_file="phrack0${i}.tar.gz"
+ else
+ local_file="${remote_file}"
+ fi
+ url="http://phrack.org/archives/tgz/${remote_file}"
+ printf "%s\n" "[inf] downloading ${url}"
+ curl -sSLf "${url}" -o "${local_file}"
+done