├── .gitlab-ci.yml ├── README.md └── distrib-dl /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | test: 2 | script: 3 | - apt-get update -qy 4 | - apt-get install -y shellcheck cloc 5 | - cloc --vcs=git . 6 | - export LC_ALL=C.UTF-8 7 | - export LANG=C.UTF-8 8 | - shellcheck distrib-dl 9 | - ./distrib-dl -c all 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # distrib-dl 2 | 3 | Download and keep up-to-date Linux/BSD distribution ISO images (installers/live images). Can be used to maintain a local ISO image repository. 4 | 5 | [![pipeline status](https://gitlab.com/nodiscc/distrib-dl/badges/master/pipeline.svg)](https://gitlab.com/nodiscc/distrib-dl/commits/master) 6 | 7 | ## Installation 8 | 9 | `git clone https://gitlab.com/nodiscc/distrib-dl` 10 | 11 | ## Requirements 12 | 13 | * bash 14 | * wget 15 | * gnupg 16 | 17 | ## Usage 18 | 19 | ``` 20 | Usage: ./distrib-dl [OPTIONS] DISTRIBUTION1 [DISTRIBUTION2 DISTRIBUTION3 ...] [all] 21 | Available distributions: debian debian-live tails kali proxmox pfsense freebsd debian-live-config fedora ubuntu 22 | Options: 23 | -c only check that the url returns 200, don't download anything 24 | -d DIR specify base download directory (by default the current working directory is used) 25 | -h show help 26 | ``` 27 | 28 | * [Debian GNU/Linux](https://www.debian.org/) (_[netinstall](https://www.debian.org/distrib/netinst)_ and _[live](https://www.debian.org/CD/live/)_) 29 | * [Tails](https://tails.boum.org/) 30 | * [Kali](https://www.kali.org/) 31 | * [Proxmox VE](https://pve.proxmox.com/wiki/Main_Page) 32 | * [pfSense](https://www.pfsense.org/download/) 33 | * [FreeBSD](https://www.freebsd.org/) 34 | * [debian-live-config](https://debian-live-config.readthedocs.io/) 35 | * [Fedora Workstation](https://getfedora.org/en/workstation/) 36 | * [Ubuntu](https://ubuntu.com/) 37 | * [Arch Linux](https://archlinux.org/) 38 | 39 | Downloads will be verified against checksums and GPG keys when available. Checksums/signatures are downloaded as part of the process. The script will return warnings unless you manually import and trust gpg keys: 40 | 41 | ``` 42 | gpg: WARNING: This key is not certified with a trusted signature! 43 | gpg: There is no indication that the signature belongs to the owner. 44 | ``` 45 | 46 | **Debian:** You need to [import Debian signing keys to your GPG keyring](https://keyring.debian.org/): 47 | 48 | ```bash 49 | gpg --keyserver keyring.debian.org --recv-keys DF9B9C49EAA9298432589D76DA87E80D6294BE9B 50 | ``` 51 | 52 | Consider a periodic cleanup of old/obsolete images from your download directory, else disk usage will keep increasing over time (unless you intend to keep old distribution releases?). 53 | 54 | 55 | ## Configuration 56 | 57 | Architectures and distribution versions are configurable in the script itself. 58 | 59 | ## Contributing/testing/support 60 | 61 | * Patches and pull requests welcome. 62 | * File bugs or possible improvements at https://gitlab.com/nodiscc/distrib-dl/issues 63 | * Run `shellcheck` against the script to check for errors/styling issues. 64 | 65 | ## TODO 66 | 67 | * add GPG/checksum verifications for proxmox 68 | * add support for [Bedrock Linux](https://bedrocklinux.org/) 69 | * add support for [Clonezilla](https://en.wikipedia.org/wiki/Clonezilla) 70 | * add support for [GNU Guix System](https://en.wikipedia.org/wiki/GNU_Guix_System) 71 | * add support for [Lakka](https://www.lakka.tv/) 72 | * add support for [NixOS](https://en.wikipedia.org/wiki/NixOS) 73 | * add support for [OpenBSD](https://en.wikipedia.org/wiki/OpenBSD) 74 | * add support for [Rocky Linux](https://en.wikipedia.org/wiki/Rocky_Linux) 75 | * add support for [AlmaLinux](https://en.wikipedia.org/wiki/AlmaLinux) 76 | * add support for [Sparky Linux](https://en.wikipedia.org/wiki/SparkyLinux) 77 | * add support for slackware 78 | * add support for opensuse 79 | * add support for void linux 80 | * add support for nixos 81 | * add support for bittorrent downloads (transmission-cli?) 82 | * add support for windows 10 83 | * automatically check for new versions of distributions (RSS feeds?) 84 | * integrate with https://github.com/ventoy/Ventoy/ 85 | * support downloading via bittorrent/transmission-cli 86 | 87 | ## License 88 | 89 | [MIT](https://opensource.org/licenses/MIT) 90 | 91 | ## Mirrors 92 | 93 | - https://stdout.root.sx/gitea/nodiscc/distrib-dl 94 | - https://gitlab.com/nodiscc/distrib-dl 95 | -------------------------------------------------------------------------------- /distrib-dl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Download and verify Linux distribution installers/ISO images 3 | # https://github.com/nodiscc/distrib-dl 4 | 5 | set -o errexit 6 | set -o nounset 7 | set -o pipefail 8 | 9 | ############################## 10 | # Configuration 11 | 12 | ### DEBIAN 13 | # one of: amd64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel multi-arch powerpc s390 s390x source sparc 14 | debian_architecture="amd64" 15 | debian_version="12.11.0" 16 | # one of: amd64, i386 17 | debian_live_architecture="amd64" 18 | # one of: cinnamon gnome kde lxde lxqt mate xfce 19 | debian_live_desktop_environment="xfce" 20 | ### TAILS 21 | tails_architecture="amd64" 22 | tails_version="6.16" 23 | ### KALI 24 | kali_architecture="amd64" 25 | kali_version="2024.4" 26 | kali_flavour="live" # live/installer 27 | ### PROXMOX 28 | # https://www.proxmox.com/en/downloads/proxmox-virtual-environment/iso 29 | proxmox_version="8.4-1" 30 | ### PFSENSE 31 | pfsense_version="2.7.2" 32 | pfsense_installer_type="vga" #serial or vga 33 | ### FREEBSD 34 | freebsd_version="13.2" 35 | ### DEBIAN-LIVE-CONFIG 36 | # https://gitlab.com/nodiscc/debian-live-config 37 | # https://github.com/nodiscc/debian-live-config/releases/ 38 | debian_live_config_version="4.2.0" 39 | ### FEDORA WORKSTATION 40 | fedora_version_major="41" 41 | fedora_version_minor="1.4" 42 | ### UBUNTU DESKTOP 43 | ubuntu_architecture="amd64" 44 | ubuntu_version="22.04.5" 45 | ### ARCHLINUX 46 | archlinux_version="2025.06.01" 47 | 48 | ############################ 49 | 50 | # abort on errors 51 | set -o errexit 52 | 53 | download_dir="$PWD" 54 | usage="$0 [OPTIONS] DISTRIBUTION1 [DISTRIBUTION2 DISTRIBUTION3 ...] [all] 55 | Available distributions: debian debian-live tails kali proxmox pfsense freebsd debian-live-config fedora ubuntu arch 56 | Options: 57 | -c only check that the url returns 200, don't download anything 58 | -d DIR specify base download directory (by default the current working directory is used) 59 | -h show help" 60 | 61 | ############################ 62 | 63 | function download_debian() { 64 | debian_base_url="https://cdimage.debian.org/debian-cd/current/${debian_architecture}/iso-cd/" 65 | debian_iso_filename="debian-${debian_version}-${debian_architecture}-netinst.iso" 66 | debian_sums_url="${debian_base_url}/SHA512SUMS" 67 | debian_sums_sign_url="${debian_base_url}/SHA512SUMS.sign" 68 | if [[ ! -d "$download_dir/debian/" ]]; then mkdir -p "$download_dir/debian/"; fi 69 | echo "[distrib-dl] Downloading Debian checksums and signature..." 70 | # shellcheck disable=SC2086 71 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian/" "$debian_sums_url" 72 | # shellcheck disable=SC2086 73 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian/" "$debian_sums_sign_url" 74 | if [[ "$verify" == "true" ]]; then 75 | echo "[distrib-dl] Verifying Debian signature..." 76 | gpg --verify "$download_dir/debian/SHA512SUMS.sign" "$download_dir/debian/SHA512SUMS" 77 | fi 78 | echo "[distrib-dl] Downloading Debian ISO image..." 79 | # shellcheck disable=SC2086 80 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian/" "$debian_base_url/$debian_iso_filename" 81 | if [[ "$verify" == "true" ]]; then 82 | echo "[distrib-dl] Verifying Debian ISO image integrity..." 83 | (cd "$download_dir/debian/" && sha512sum --check --ignore-missing <(cat SHA512SUMS)) 84 | fi 85 | } 86 | 87 | function download_debian_live() { 88 | debian_live_base_url="https://cdimage.debian.org/cdimage/release/current-live/${debian_live_architecture}/iso-hybrid/" 89 | debian_live_iso_filename="debian-live-${debian_version}-${debian_live_architecture}-${debian_live_desktop_environment}.iso" 90 | debian_live_sums_url="${debian_live_base_url}/SHA512SUMS" 91 | debian_live_sums_sign_url="${debian_live_base_url}/SHA512SUMS.sign" 92 | if [[ ! -d "$download_dir/debian-live/" ]]; then mkdir -p "$download_dir/debian-live/"; fi 93 | echo "[distrib-dl] Downloading Debian Live checksums and signature..." 94 | # shellcheck disable=SC2086 95 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian-live/" "$debian_live_sums_url" 96 | # shellcheck disable=SC2086 97 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian-live/" "$debian_live_sums_sign_url" 98 | if [[ "$verify" == "true" ]]; then 99 | echo "[distrib-dl] Verifying Debian Live signature..." 100 | gpg --verify "$download_dir/debian-live/SHA512SUMS.sign" "$download_dir/debian-live/SHA512SUMS" 101 | fi 102 | echo "[distrib-dl] Downloading Debian Live ISO image..." 103 | # shellcheck disable=SC2086 104 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian-live/" "$debian_live_base_url/$debian_live_iso_filename" 105 | if [[ "$verify" == "true" ]]; then 106 | echo "[distrib-dl] Verifying Debian Live ISO image integrity..." 107 | (cd "$download_dir/debian-live/" && sha512sum --ignore-missing -c <(cat SHA512SUMS)) 108 | fi 109 | } 110 | 111 | function download_tails() { 112 | if [[ ! -d "$download_dir/tails/" ]]; then mkdir -p "$download_dir/tails/"; fi 113 | tails_iso_url="https://mirrors.wikimedia.org/tails/stable/tails-${tails_architecture}-${tails_version}/tails-${tails_architecture}-${tails_version}.iso" 114 | tails_key_url="https://tails.boum.org/tails-signing.key" 115 | tails_sig_url="https://tails.boum.org/torrents/files/tails-${tails_architecture}-${tails_version}.iso.sig" 116 | echo "[distrib-dl] INFO: downloading Tails key and signature..." 117 | # shellcheck disable=SC2086 118 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/tails/" "$tails_key_url" 119 | # shellcheck disable=SC2086 120 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/tails/" "$tails_sig_url" 121 | if [[ "$verify" == "true" ]]; then 122 | echo "[distrib-dl] INFO: Importing tails GPG key..." 123 | gpg --import "$download_dir/tails/tails-signing.key" 124 | fi 125 | echo "[distrib-dl] INFO: downloading Tails ISO image" 126 | # shellcheck disable=SC2086 127 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/tails/" "$tails_iso_url" 128 | if [[ "$verify" == "true" ]]; then 129 | echo "[distrib-dl] INFO: verifying Tails signature..." 130 | tails_sig_filename="tails-${tails_architecture}-${tails_version}.iso.sig" 131 | tails_iso_filename="tails-${tails_architecture}-${tails_version}.iso" 132 | gpg --keyid-format 0xlong --verify "$download_dir/tails/$tails_sig_filename" "$download_dir/tails/$tails_iso_filename" 133 | fi 134 | } 135 | 136 | function download_kali() { 137 | kali_base_url="https://cdimage.kali.org/kali-$kali_version/" 138 | kali_iso_filename="kali-linux-$kali_version-$kali_flavour-$kali_architecture.iso" 139 | kali_key_url="https://archive.kali.org/archive-key.asc" 140 | if [[ ! -d "$download_dir/kali/" ]]; then mkdir -p "$download_dir/kali/"; fi 141 | echo "[distrib-dl] Downloading Kali checksums, key and signature..." 142 | # shellcheck disable=SC2086 143 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/kali/" "$kali_base_url/SHA256SUMS" 144 | # shellcheck disable=SC2086 145 | wget $wget_opts --continue --show-progress -O "$download_dir/kali/SHA256SUMS.gpg" "$kali_base_url/SHA256SUMS.gpg" 146 | # shellcheck disable=SC2086 147 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/kali/" "$kali_key_url" 148 | echo "[distrib-dl] INFO: Importing Kali GPG key..." 149 | if [[ "$verify" == "true" ]]; then 150 | gpg --import "$download_dir/kali/archive-key.asc" 151 | echo "[distrib-dl] Verifying Kali signature..." 152 | gpg --verify "$download_dir/kali/SHA256SUMS.gpg" "$download_dir/kali/SHA256SUMS" 153 | fi 154 | echo "[distrib-dl] INFO: Downloading Kali ISO image..." 155 | # shellcheck disable=SC2086 156 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/kali/" "$kali_base_url/$kali_iso_filename" 157 | if [[ "$verify" == "true" ]]; then 158 | echo "[distrib-dl] INFO: Verifying Kali ISO image integrity..." 159 | (cd "$download_dir/kali/" && sha256sum --check --ignore-missing <(grep "$kali_iso_filename" SHA256SUMS)) 160 | fi 161 | } 162 | 163 | function download_proxmox { 164 | # https://pve.proxmox.com/wiki/Roadmap 165 | # TODO checksums/gpg verify download 166 | if [[ ! -d "$download_dir/kali/" ]]; then mkdir -p "$download_dir/kali/"; fi 167 | proxmox_base_url="https://enterprise.proxmox.com/iso" 168 | # shellcheck disable=SC2086 169 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/proxmox/" "$proxmox_base_url/proxmox-ve_$proxmox_version.iso" 170 | } 171 | 172 | function download_pfsense { 173 | # New York mirror (disabled) 174 | #pfsense_base_url="https://nyifiles.pfsense.org/mirror/downloads" 175 | # Main site (disabled, does not redirect properly) 176 | #pfsense_base_url="https://files.pfsense.org/mirror/downloads" 177 | # Frankfurt mirror 178 | pfsense_base_url="https://frafiles.pfsense.org/mirror/downloads" 179 | if [[ "$pfsense_installer_type" == "serial" ]]; then pfsense_is_serial="serial-" 180 | elif [[ "$pfsense_installer_type" == "vga" ]]; then pfsense_is_serial="" 181 | else echo "[distrib-dl] ERROR: invalid installer type for pfsense: $pfsense_installer_type"; exit 1 182 | fi 183 | pfsense_iso_filename="pfSense-CE-memstick-${pfsense_is_serial}${pfsense_version}-RELEASE-amd64.img.gz" 184 | pfsense_hashes_base_url="https://www.pfsense.org/hashes/" 185 | if [[ ! -d "$download_dir/pfsense/" ]]; then mkdir -p "$download_dir/pfsense/"; fi 186 | echo "[distrib-dl] INFO: downloading pfsense checksums..." 187 | # shellcheck disable=SC2086 188 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/pfsense/" "${pfsense_hashes_base_url}/${pfsense_iso_filename}.sha256" 189 | echo "[distrib-dl] INFO: downloading pfsense ISO image..." 190 | # shellcheck disable=SC2086 191 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/pfsense/" "${pfsense_base_url}/${pfsense_iso_filename}" 192 | if [[ "$verify" == "true" ]]; then 193 | echo "[distrib-dl] INFO: verifying pfsense ISO image integrity..." 194 | (cd "$download_dir/pfsense" && sha256sum --check "pfSense-CE-memstick-${pfsense_is_serial}${pfsense_version}-RELEASE-amd64.img.gz.sha256") 195 | fi 196 | } 197 | 198 | function download_freebsd() { 199 | freebsd_base_url="https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/${freebsd_version}" 200 | freebsd_iso_filename="FreeBSD-${freebsd_version}-RELEASE-amd64-memstick.img" 201 | freebsd_sums_filename="CHECKSUM.SHA512-FreeBSD-${freebsd_version}-RELEASE-amd64" 202 | freebsd_gpgkeyring_url="https://docs.freebsd.org/pgpkeys/pgpkeys.txt" 203 | if [[ ! -d "$download_dir/freebsd/" ]]; then mkdir -p "$download_dir/freebsd/"; fi 204 | echo "[distrib-dl] INFO: Downloading freebsd keyring, checksums and signature..." 205 | # shellcheck disable=SC2086 206 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/freebsd/" "$freebsd_gpgkeyring_url" 207 | # shellcheck disable=SC2086 208 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/freebsd/" "$freebsd_base_url/$freebsd_sums_filename" 209 | echo "[distrib-dl] INFO: Downloading freebsd ISO image..." 210 | # shellcheck disable=SC2086 211 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/freebsd/" "$freebsd_base_url/$freebsd_iso_filename" 212 | if [[ "$verify" == "true" ]]; then 213 | echo "Verifying freebsd ISO image integrity..." 214 | (cd "$download_dir/freebsd/" && sha512sum --ignore-missing -c <(cat ${freebsd_sums_filename})) 215 | fi 216 | } 217 | 218 | function download_debian_live_config() { 219 | # https://gitlab.com/nodiscc/debian-live-config 220 | debian_live_config_base_url="https://github.com/nodiscc/debian-live-config/releases/download/$debian_live_config_version/" 221 | debian_live_config_iso_filename="debian-live-config-${debian_live_config_version}-debian-bookworm-amd64.iso" 222 | debian_live_config_key_url="${debian_live_config_base_url}/debian-live-config-release.key" 223 | debian_live_config_sums_url="${debian_live_config_base_url}/SHA512SUMS" 224 | debian_live_config_sums_sign_url="${debian_live_config_base_url}/SHA512SUMS.sign" 225 | if [[ ! -d "$download_dir/debian-live-config/" ]]; then mkdir -p "$download_dir/debian-live-config/"; fi 226 | echo "[distrib-dl] Downloading debian-live-config checksums and signature..." 227 | # shellcheck disable=SC2086 228 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian-live-config/" "$debian_live_config_sums_url" 229 | # shellcheck disable=SC2086 230 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian-live-config/" "$debian_live_config_sums_sign_url" 231 | # shellcheck disable=SC2086 232 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/debian-live-config/" "$debian_live_config_key_url" 233 | if [[ "$verify" == "true" ]]; then 234 | echo "[distrib-dl] Importing debian-live-config GPG key..." 235 | gpg --import "$download_dir/debian-live-config/debian-live-config-release.key" 236 | echo "[distrib-dl] Verifying debian-live-config signature..." 237 | gpg --verify "$download_dir/debian-live-config/SHA512SUMS.sign" "$download_dir/debian-live-config/SHA512SUMS" 238 | fi 239 | echo "[distrib-dl] Downloading debian-live-config ISO image..." 240 | # shellcheck disable=SC2086 241 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/debian-live-config/" "$debian_live_config_base_url/$debian_live_config_iso_filename" 242 | if [[ "$verify" == "true" ]]; then 243 | echo "[distrib-dl] Verifying debian-live-config ISO image integrity..." 244 | (cd "$download_dir/debian-live-config/" && sha512sum -c <(cat SHA512SUMS)) 245 | fi 246 | } 247 | 248 | 249 | function download_fedora() { 250 | fedora_version_full="${fedora_version_major}-${fedora_version_minor}" 251 | fedora_iso_filename="Fedora-Workstation-Live-x86_64-${fedora_version_full}.iso" 252 | fedora_iso_url="https://download.fedoraproject.org/pub/fedora/linux/releases/${fedora_version_major}/Workstation/x86_64/iso/${fedora_iso_filename}" 253 | fedora_sums_filename="Fedora-Workstation-${fedora_version_major}-${fedora_version_minor}-x86_64-CHECKSUM" 254 | fedora_sums_url="https://download.fedoraproject.org/pub/fedora/linux/releases/${fedora_version_major}/Workstation/x86_64/iso/${fedora_sums_filename}" 255 | fedora_key_filename="fedora.gpg" 256 | fedora_key_url="https://getfedora.org/static/${fedora_key_filename}" 257 | if [[ ! -d "$download_dir/fedora/" ]]; then mkdir -p "$download_dir/fedora/"; fi 258 | echo "[distrib-dl] Downloading fedora checksums and signature..." 259 | # shellcheck disable=SC2086 260 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/fedora/" "$fedora_sums_url" 261 | # shellcheck disable=SC2086 262 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/fedora/" "$fedora_key_url" 263 | if [[ "$verify" == "true" ]]; then 264 | echo "[distrib-dl] Importing fedora GPG key..." 265 | gpg --import "$download_dir/fedora/$fedora_key_filename" 266 | echo "[distrib-dl] Verifying fedora signature..." 267 | (cd "$download_dir/fedora/" && gpg --verify-files "$fedora_sums_filename") 268 | fi 269 | echo "[distrib-dl] Downloading fedora ISO image..." 270 | # shellcheck disable=SC2086 271 | wget $wget_opts --continue --timestamping --show-progress --directory-prefix="$download_dir/fedora/" "$fedora_iso_url" 272 | if [[ "$verify" == "true" ]]; then 273 | echo "[distrib-dl] Verifying fedora ISO image integrity..." 274 | (cd "$download_dir/fedora" && sha256sum -c "$fedora_sums_filename") 275 | fi 276 | } 277 | 278 | function download_ubuntu() { 279 | ubuntu_base_url="https://releases.ubuntu.com/${ubuntu_version}" 280 | ubuntu_iso_filename="ubuntu-${ubuntu_version}-desktop-${ubuntu_architecture}.iso" 281 | ubuntu_sums_url="${ubuntu_base_url}/SHA256SUMS" 282 | ubuntu_sums_sign_url="${ubuntu_base_url}/SHA256SUMS.gpg" 283 | if [[ ! -d "$download_dir/ubuntu/" ]]; then mkdir -p "$download_dir/ubuntu/"; fi 284 | echo "[distrib-dl] Downloading Ubuntu checksums and signature..." 285 | # shellcheck disable=SC2086 286 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/ubuntu/" "$ubuntu_sums_url" 287 | # shellcheck disable=SC2086 288 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/ubuntu/" "$ubuntu_sums_sign_url" 289 | if [[ "$verify" == "true" ]]; then 290 | echo "[distrib-dl] Verifying Ubuntu signature..." 291 | gpg --keyid-format long --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x843938DF228D22F7B3742BC0D94AA3F0EFE21092 292 | gpg --keyid-format long --verify "$download_dir/ubuntu/SHA256SUMS.gpg" "$download_dir/ubuntu/SHA256SUMS" 293 | fi 294 | echo "[distrib-dl] Downloading Ubuntu ISO image..." 295 | # shellcheck disable=SC2086 296 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/ubuntu/" "$ubuntu_base_url/$ubuntu_iso_filename" 297 | if [[ "$verify" == "true" ]]; then 298 | echo "[distrib-dl] Verifying Ubuntu ISO image integrity..." 299 | (cd "$download_dir/ubuntu/" && sha256sum --check --ignore-missing <(cat SHA256SUMS)) 300 | fi 301 | } 302 | 303 | function download_archlinux() { 304 | archlinux_base_url="https://geo.mirror.pkgbuild.com/iso/${archlinux_version}/" 305 | archlinux_iso_filename="archlinux-x86_64.iso" 306 | archlinux_sums_url="https://archlinux.org/iso/${archlinux_version}/sha256sums.txt" 307 | archlinux_sums_sign_url="https://geo.mirror.pkgbuild.com/iso/${archlinux_version}/archlinux-x86_64.iso.sig" 308 | if [[ ! -d "$download_dir/archlinux/" ]]; then mkdir -p "$download_dir/archlinux/"; fi 309 | echo "[distrib-dl] Downloading Arch Linux checksums and signature..." 310 | # shellcheck disable=SC2086 311 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/archlinux/" "$archlinux_sums_url" 312 | # shellcheck disable=SC2086 313 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/archlinux/" "$archlinux_sums_sign_url" 314 | echo "[distrib-dl] Downloading Arch Linux ISO image..." 315 | # shellcheck disable=SC2086 316 | wget $wget_opts --timestamping --show-progress --directory-prefix="$download_dir/archlinux/" "$archlinux_base_url/$archlinux_iso_filename" 317 | if [[ "$verify" == "true" ]]; then 318 | echo "[distrib-dl] Verifying Arch Linux signature..." 319 | gpg --auto-key-locate clear,wkd -v --locate-external-key pierre@archlinux.org 320 | gpg --verify "$download_dir/archlinux/archlinux-x86_64.iso.sig" "$download_dir/archlinux/archlinux-x86_64.iso" 321 | echo "[distrib-dl] Verifying Arch Linux ISO image integrity..." 322 | (cd "$download_dir/archlinux/" && sha256sum --check --ignore-missing <(cat sha256sums.txt)) 323 | fi 324 | } 325 | 326 | function _main() { 327 | wget_opts="--no-verbose" 328 | verify="true" 329 | while getopts ":cd:h" opt; do 330 | case $opt in 331 | c) wget_opts="--spider"; verify="false"; shift;; 332 | d) download_dir="$OPTARG"; shift;; 333 | h) echo "Usage: $usage"; exit 0;; 334 | \?) echo "[distrib-dl] ERROR: invalid option -$OPTARG" >&2; echo "Usage: $usage"; exit 1;; 335 | esac 336 | done 337 | 338 | for distribution in "$@"; do 339 | if [[ "$distribution" == "debian" ]] ; then download_debian; fi 340 | if [[ "$distribution" == "debian-live" ]] ; then download_debian_live; fi 341 | if [[ "$distribution" == "tails" ]] ; then download_tails; fi 342 | if [[ "$distribution" == "kali" ]] ; then download_kali; fi 343 | if [[ "$distribution" == "proxmox" ]] ; then download_proxmox; fi 344 | if [[ "$distribution" == "pfsense" ]] ; then download_pfsense; fi 345 | if [[ "$distribution" == "freebsd" ]] ; then download_freebsd; fi 346 | if [[ "$distribution" == "debian-live-config" ]] ; then download_debian_live_config; fi 347 | if [[ "$distribution" == "fedora" ]] ; then download_fedora; fi 348 | if [[ "$distribution" == "ubuntu" ]] ; then download_ubuntu; fi 349 | if [[ "$distribution" == "archlinux" ]] ; then download_archlinux; fi 350 | if [[ "$distribution" == "all" ]] ; then download_debian && download_debian_live && download_tails && download_kali && download_proxmox && download_pfsense && download_freebsd && download_debian_live_config && download_fedora && download_ubuntu && download_archlinux; fi 351 | done 352 | } 353 | 354 | ##################### 355 | 356 | _main "$@" 357 | --------------------------------------------------------------------------------