├── .github
└── FUNDING.yml
├── LICENSE
├── README.md
├── distrofunctions.sh
└── download.sh
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: ['sxiii']
4 | patreon: sxiii
5 | open_collective: sxiii
6 | ko_fi: sxiii
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: sxiii
10 | issuehunt: sxiii
11 | otechie: meta
12 | custom: ['https://sxiii.ru/donate']
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyleft 2020-2023 Dennis Ivanov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## linux-downloader
2 | Bash script for autodownloading of different latest, "bleeding edge" Linux distros and testing them in qemu VM. Other than Linux, it also boots *BSDs families and other opensource projects. Currently about 100 Linux, BSD and alternative OS distributions are supported in 8 different "families". Also, booting from iPXE mirrors (netboot.xyz and boot.salstar.sk) is supported.
3 |
4 | ## Linux Distrohopper Dream Machine Script
5 | ```
6 | /----------------------------------------------------------------------------------\
7 | | Script downloads recent (latest release) linux ISOs and spins a VM for a test. |
8 | | This is distrohopper dream machine. It consist of the file with distro download |
9 | | functions (distrofunctions.sh) as well as this script. Theoretically, the script |
10 | | should always download recent linux ISOs without any updates. But, if the dev(s) |
11 | | change the download URL or something else, it might be required to do manual |
12 | | changes - distrofunctions.sh. |
13 | \----------------------------------------------------------------------------------/
14 | ```
15 |
16 | ## Requirements:
17 | * Basic stuff: `linux`, `bash`, `curl`, `wget`, `awk`, `grep`, `xargs`, `pr` (these tools usually are preinstalled on linux)
18 | * Additional depencency: `html2text` (for PopOS, Fedora, Rosa, Alma, Rocky, Adelie), `aria2` (for PopOS)
19 | * If you want to run a VM after downloading, you'll need `QEMU`
20 | * Some distros are shared as archive. So you'll need `xz` for guix, `bzip2` for minix, `zip` for haiku & reactos, and, finally `7z` for kolibri.
21 | ### Install all deps on Arch-based distro
22 | `sudo pacman -S html2text aria2 p7zip xz bzip2 qemu`
23 | ### Install all deps on Debian based distro
24 | `sudo ap-get install html2text aria2 p7zip xz-utils bzip2 qemu`
25 |
26 | ## Currently supported distributions
27 | If you can't find your favourite linux distro in here, please create a github issue with details about it or add support for it yourself and do a pull request.
28 | ```
29 | Arch-based: DEB-based: RPM-based: Other: Source-based: Containers and DCs: BSD, NAS, Firewall: Not linux:
30 | 0 = archlinux 17 = debian 35 = fedora 52 = alpine 69 = gentoo 77 = rancheros 85 = freebsd 99 = openindiana
31 | 1 = manjaro 18 = ubuntu 36 = centos 53 = tinycore 70 = sabayon 78 = k3os 86 = netbsd 100 = minix
32 | 2 = arcolinux 19 = linuxmint 37 = opensuse 54 = porteus 71 = calculate 79 = flatcar 87 = openbsd 101 = haiku
33 | 3 = archbang 20 = zorinos 38 = rosa 55 = slitaz 72 = nixos 80 = silverblue 88 = ghostbsd 102 = menuetos
34 | 4 = parabola 21 = popos 39 = altlinux 56 = pclinuxos 73 = guix 81 = photon 89 = hellosystem 103 = kolibri
35 | 5 = endeavour 22 = deepin 40 = mandriva 57 = void 74 = crux 82 = coreos 90 = dragonflybsd 104 = reactos
36 | 6 = artix 23 = mxlinux 41 = mageia 58 = fourmlinux 75 = gobolinux 83 = dcos 91 = pfsense 105 = freedos
37 | 7 = arco 24 = knoppix 42 = clearos 59 = kaos 76 = easyos 84 = proxmox 92 = opnsense
38 | 8 = garuda 25 = kali 43 = alma 60 = clearlinux 93 = midnightbsd
39 | 9 = rebornos 26 = puppy 44 = rocky 61 = dragora 94 = truenas
40 | 10 = archlabs 27 = pureos 45 = qubes 62 = slackware 95 = nomadbsd
41 | 11 = namib 28 = elementary 46 = nobara 63 = adelie 96 = hardenedbsd
42 | 12 = obarun 29 = backbox 47 = ultramarine 64 = plop 97 = xigmanas
43 | 13 = archcraft 30 = devuan 48 = springdale 65 = solus 98 = clonos
44 | 14 = peux 31 = jingos 49 = berry 66 = peropesis
45 | 15 = bluestar 32 = cutefishos 50 = risios 67 = openmamba
46 | 16 = xerolinux 33 = parrot 51 = eurolinux 68 = pisi
47 | 34 = tailsos
48 | ```
49 |
50 | ## How to use?
51 | 1. `git clone https://github.com/sxiii/linux-downloader`
52 | 2. `cd linux-downloader`
53 | 3. `./download.sh`
54 | If you manually pick distros (opt. one or two) you will be prompted about launching a VM for test spin for each distro.
55 | Multiple values are also supported:
56 | * one distribution (e.g. type 0 for archlinux)*
57 | * several distros - space separated (e.g. for getting both Arch and Manjaro, type '0 1' (without quotes))*
58 | * 'all' option, the script will ONLY download ALL of the ISOs (warning: this can take a lot of space (~128 GB) as well as several hours to download everything!)
59 | * 'filesize' option will check the local (downloaded) filesizes of ISOs vs. the current/recent ISOs filesizes on the websites
60 | * 'netbootxyz' option allows you to boot from netboot.xyz via network
61 | * 'netbootsal' option will boot from boot.salstar.sk
62 |
63 | ## Verified as working
64 | This script verified as working correctly on the following OSes:
65 | * Garuda Linux Soaring Talon
66 | * Fedora 33 Workstation (Pre-release)
67 | * Ubuntu 20.04
68 | * Manjaro 21.0.5 Ornara
69 | * Probably will work almost everywhere
70 |
71 | ## How to add distribution yourself
72 | 0. Clone the repo, if you hadn't already, and enter the resuling folder:
73 | ```
74 | git clone https://github.com/sxiii/linux-downloader && cd linux-downloader
75 | ```
76 | 1. Open file "download.sh" with your favourite text editor. In the according row of "Categories", add the name of your distro in the end of the array.
77 | 2. In the same file, little bit down further, add your distro variable (array) like this: (the order is the same as in "Categories")
78 | ```
79 | distroname=("Full Distro Name" "arch" "releasename" "distronameurl")
80 | ```
81 | Here is the real example to make it more obvious:
82 | ```
83 | obarun=("Obarun" "amd64" "rolling" "obarunurl")
84 | ```
85 | 3. Save & close the "download.sh" file. Now, open "distrofunctions.sh" file. This is more tricky. We need to AUTOMATICALLY get the URL of the most recent distribution (fixed-links are forbidden as they will destroy the idea behind this script of always get the recent release). So you need to find a way to get the recent release full download URL. For example, if we want to download from Sourceforge.net, make a new function like this:
86 | ```
87 | distronameurl () {
88 | mirror="https://sourceforge.net/projects/SF-Project-Name/files/latest/download"
89 | new="$mirror"
90 | output="distroname.iso"
91 | checkfile $1
92 | }
93 | ```
94 | Here you will need to edit: function name (distronameurl), mirror address (in this example we're downloading project "SF-Project-Name" from sourceforge), output file name. Checkfile is the function that checks if file exists and downloads the file if not, so don't touch it. If you are going to download not from sourceforge, but from some other website, please check the other distributions for examples - there are plenty of examples of how to parse websites to get the recent download links automatically. In the end, you need to supply "new" variable with full ISO URL, as well as "output" var with filename (and mirror variable is there for cleaniness of the code and code consistancy). Other than that, you can use "grep, awk, xargs" or other classic UNIX tools to parse the HTML (or several files) and get the actual download link. If you'll create temporary files, please don't forget to remove them in the end of the function. You can as well parse file listings like HTTP or FTP server mirror hosts. If you can't write the correct code, feel free to create an issue and ask me for help.
95 |
96 | 4. Now, save the "distrofunctions.sh" file. Run the ./download.sh script, type-in number of your distribution, and check, that it's downloaded correctly.
97 | 5. Last but very important, please create a pull request, so I could check and add distribution of your choice.
98 |
99 | Thank you!
100 |
101 | ## Help needed
102 | "Work-in-progress". To do:
103 | 1. Multiple architecture support
104 | 2. Multiple download mirror support
105 | ~3. Adding more distributions (current goal: 100)~
106 |
107 | ## Notes on files
108 | * download.sh is in the main script
109 | * distrofunctions.sh contains all URL/mirror/HTTP scraping stuff
110 |
111 | Feel free to do a pull request or ask me to add your favourite distro in the issues.
112 | NB: I prefer the distros updated at least during the last 2-3 years (ideally, 1 year). Exceptions can be historically important releases and rare/special operating systems.
113 |
114 | ## Author & License
115 | * Written by SecurityXIII
116 | * Project began in August 2020 - but since then improved several times
117 | * Kopimi un-license as well as MIT
118 |
--------------------------------------------------------------------------------
/distrofunctions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Download functions and commands
4 |
5 | output_path () {
6 | if [ -n "$output_dir" ];then
7 | local output_path="${output_dir}/";
8 | fi
9 | output="${output_path}$1"
10 | }
11 |
12 | wgetcmd () {
13 | if [ -n "$output_dir" ] && [ ! -d "$output_dir" ];then
14 | echo "The image destination path \"$output_dir\" doesn't exist. Do you want to create it ? (y / n)"
15 | read create_path
16 | if [ "$create_path" = "y" ];then
17 | mkdir -p "$output_dir"
18 | else
19 | exit 1
20 | fi
21 | fi
22 | echo "Downloading $new to $output"
23 | wget -q --show-progress -c "$new" -O "$output" -o /dev/null
24 | }
25 |
26 | # Function to only get filesize
27 | getsize () {
28 | abc=$(wget --spider $new 2>&1)
29 | y=$(echo $abc | awk -F"Length:" '{ print $2 }' | awk -F"[" '{ print $1 }')
30 | ss=$(ls -l -B $output | awk -F" " '{ print $5 }')
31 | sh=$(ls -lh $output | awk -F" " '{ print $5 }')
32 | printf "File: $new has size: $y while on disk it is $output - $ss ($sh) \n"
33 | }
34 |
35 | # This can be adopted for using torrents instead of direct HTTP/FTP files
36 | ariacmd () { aria2c --seed-time=0 -c $new; }
37 | # Set seeding time after downloading to zero ( this is sad :-( remove --seed-time=0 if you like to seed :-) )
38 |
39 | # Other functions
40 |
41 | notlive () {
42 | echo " / / ---------------------------------------------------------------------- \ \ "
43 | echo " | | Note: this is not a live disk (it'll require further installation). | | "
44 | echo " \ \ -----------------------------------------------------------------------/ / "
45 | }
46 |
47 | notlinux () {
48 | echo " / / ------------------------------------------------------------------------------------- \ \ "
49 | echo " | | Note: this isn't actually linux. It was included as it's important opensource project | | "
50 | echo " \ \ --------------------------------------------------------------------------------------/ / "
51 | }
52 |
53 | empty () {
54 | echo "The file $output is empty. Please download it first." # This function does nothing
55 | }
56 |
57 | checkfile () {
58 | if [ "$1" == "filesize" ]; then
59 | [ -s $output ] && getsize || empty
60 | else
61 | wgetcmd
62 | fi
63 | }
64 |
65 | # Update latest distro URL functions
66 |
67 | archurl () {
68 | mirror="https://archlinux.org/download/"
69 | x=$(curl -s $mirror | grep -m1 geo | awk -F"\"" '{ print $2 }')
70 | y=$(curl -s $x | grep -m1 archlinux | awk -F".iso" '{ print $1 }' | awk -F"\"" '{ print $2 }' );
71 | new="$x/$y.iso"
72 | output_path "archlinux.iso"
73 | checkfile $1
74 | }
75 |
76 | manjarourl () {
77 | mirror="https://manjaro.org/download/"
78 | x=$(curl -s $mirror | grep btn-fi | grep xfce | awk -F"\"" '{ print $4 }')
79 | new="$x"
80 | output_path "manjaro.iso"
81 | checkfile $1
82 | }
83 |
84 | arcourl () {
85 | mirror="https://bike.seedhost.eu/arcolinux/iso/"
86 | x=$(curl -s $mirror | grep -m1 arcolinux- | awk -F">" '{ print $3 }' | awk -F"<" '{ print $1 }')
87 | new="$mirror/$x"
88 | output_path "arcolinux.iso"
89 | checkfile $1
90 | }
91 |
92 | archbangurl () {
93 | mirror="https://sourceforge.net/projects/archbang/files/latest/download"
94 | new="$mirror"
95 | output_path "archbang.iso"
96 | checkfile $1
97 | }
98 |
99 | parabolaurl () {
100 | mirror="https://wiki.parabola.nu/Get_Parabola"
101 | new=$(curl -s $mirror | grep iso | grep Web | awk -F"\"" '{ print $18 }' | grep iso -m1)
102 | output_path "parabola.iso"
103 | checkfile $1
104 | }
105 |
106 | endeavoururl () {
107 | mirror="https://sourceforge.net/projects/endeavouros-repository/files/latest/download"
108 | new="$mirror"
109 | output_path "endeavour.iso"
110 | checkfile $1
111 | }
112 |
113 | artixurl () {
114 | mirror="https://mirrors.dotsrc.org/artix-linux/iso/"
115 | x=$(curl -s $mirror | grep mate-openrc | head -1 | awk -F\" '{ print $2 }')
116 | new="$mirror/$x"
117 | output_path "artix.iso"
118 | checkfile $1
119 | }
120 |
121 | arcourl () {
122 | mirror="https://sourceforge.net/projects/arcolinux/files/latest/download"
123 | new="$mirror"
124 | output_path "arco.iso"
125 | checkfile $1
126 | }
127 |
128 | garudaurl () {
129 | mirror="https://sourceforge.net/projects/garuda-linux/files/latest/download"
130 | new="$mirror"
131 | output_path "garuda.iso"
132 | checkfile $1
133 | }
134 |
135 | rebornurl () {
136 | mirror="https://sourceforge.net/projects/rebornos/files/latest/download"
137 | new="$mirror"
138 | output_path "rebornos.iso"
139 | checkfile $1
140 | }
141 |
142 | archlabsurl () {
143 | mirror="https://sourceforge.net/projects/archlabs-linux-minimo/files/latest/download"
144 | new="$mirror"
145 | output_path "archlabs.iso"
146 | checkfile $1
147 | }
148 |
149 | namiburl () {
150 | mirror="https://sourceforge.net/projects/namib-gnu-linux/files/latest/download"
151 | new="$mirror"
152 | output_path "namib.iso"
153 | checkfile $1
154 | }
155 |
156 | obarunurl () {
157 | mirror="https://repo.obarun.org/iso/"
158 | x=$(curl -s $mirror | grep "
" '{ print $7 }' | awk -F"<" '{ print $1 }')
267 | new="$mirror/$x"
268 | output_path "kali.iso"
269 | checkfile $1
270 | }
271 |
272 | puppyurl () {
273 | mirror="http://distro.ibiblio.org/puppylinux/puppy-bionic/bionicpup64/"
274 | x=$(curl -s $mirror | grep -m1 uefi.iso | awk -F">" '{ print $4 }' | awk -F"<" '{ print $1 }')
275 | new="$mirror/$x"
276 | output_path "puppy.iso"
277 | checkfile $1
278 | }
279 |
280 | pureurl () {
281 | mirror="https://pureos.net/download/"
282 | new=$(curl -s $mirror | grep -m1 iso | awk -F"\"" '{ print $2 }')
283 | output_path "pureos.iso"
284 | checkfile $1
285 | }
286 |
287 | elementurl () {
288 | mirror="https://elementary.io"
289 | one=$(curl -s $mirror 2>&1 | grep -m1 download-link | awk -F"//" '{ print $2 }' | awk -F\" '{ print $1 }')
290 | new="$one"
291 | output_path "elementaryos.iso"
292 | checkfile $1
293 | }
294 |
295 | backboxurl () {
296 | mirror="https://bit.ly/2yNWmF3"
297 | new="$mirror"
298 | output_path "backbox.iso"
299 | checkfile $1
300 | }
301 |
302 | devuanurl () {
303 | mirror="https://www.devuan.org/get-devuan"
304 | x=$(curl -s $mirror | grep -A5 HTTPS | grep href | awk -F"\"" '{ print $2 }')
305 | one=$(curl -s $x | grep daed | awk -F"\"" '{ print $4 }')
306 | two=$(curl -s $x/$one | grep desktop-live | awk -F"\"" '{ print $4 }')
307 | three=$(curl -s $x/$one/$two | grep -m1 amd64 | awk -F"\"" '{ print $4 }')
308 | new="$x/$one/$two/$three"
309 | output_path "devuan.iso"
310 | checkfile $1
311 | }
312 |
313 | jingosurl () {
314 | mirror="https://download.jingos.com/os/JingOS-V0.9-a25ea3.iso"
315 | new="$mirror"
316 | output_path "jingos.iso"
317 | checkfile $1
318 | }
319 |
320 | cutefishosurl () {
321 | mirror="https://sourceforge.net/projects/cutefish-ubuntu/files/latest/download"
322 | new="$mirror"
323 | output_path "cutefishos.iso"
324 | checkfile $1
325 | }
326 |
327 | parroturl () {
328 | mirror="https://deb.parrot.sh/direct/parrot/iso/testing/"
329 | x=$(curl -s $mirror | grep "home" | grep -m1 amd64.iso | awk -F"\"" '{ print $4 }')
330 | new="$mirror$x"
331 | output_path "parrot.iso"
332 | checkfile $1
333 | }
334 |
335 |
336 | fedoraurl () {
337 | mirror="https://getfedora.org/en/workstation/download/"
338 | new=$(curl -s $mirror | html2text | grep -m2 iso | awk -F "(" 'NR%2{printf "%s",$0;next;}1' | awk -F"(" '{ print $2 }' | awk -F")" '{ print $1 }')
339 | # Legacy
340 | #mirror="https://www.happyassassin.net/nightlies.html"
341 | #x=$(curl -s $mirror | grep -m1 Fedora-Workstation-Live-x86_64-Rawhide | awk -F\" '{ print $4 }')
342 | #new="$x"
343 | output_path "fedora.iso"
344 | checkfile $1
345 | }
346 |
347 | centosurl () {
348 | mirror="https://www.centos.org/centos-stream/"
349 | x=$(curl -s $mirror | grep -m1 x86_64 | awk -F"\"" '{ print $2 }' | awk -F"&" '{ print $1 }')
350 | new=$(curl $x | grep https -m1)
351 | output_path "centos.iso"
352 | notlive
353 | checkfile $1
354 | }
355 |
356 | suseurl () {
357 | mirror="https://get.opensuse.org/tumbleweed/#download"
358 | new=$(curl -s $mirror | grep -m1 Current.iso | awk -F"\"" '{ print $2 }' | awk -F"\"" '{ print $1 }')
359 | output_path "opensuse.iso"
360 | checkfile $1
361 | }
362 |
363 | rosaurl () {
364 | mirror="https://www.rosalinux.ru/rosa-linux-download-links/"
365 | new=$(curl -s $mirror | html2text | grep -m1 "64-bit ISO" | awk -F"(" '{ print $2 }' | awk -F" " '{ print $1 }')
366 | output_path "rosa.iso"
367 | checkfile $1
368 | }
369 |
370 | mandrivaurl () {
371 | mirror="https://sourceforge.net/projects/openmandriva/files/latest/download"
372 | new="$mirror"
373 | output_path "mandriva.iso"
374 | checkfile $1
375 | }
376 |
377 | mageiaurl () {
378 | mirror="https://mirror.yandex.ru/mageia/iso/cauldron/"
379 | one=$(curl -s $mirror | grep Live-Xfce-x86_64 | awk -F"\"" '{ print $2 }')
380 | two=$(curl -s $mirror/$one | grep -m1 "x86_64.iso" | awk -F"\"" '{ print $2 }')
381 | new="$mirror/$one/$two"
382 | output_path "mageia.iso"
383 | checkfile $1
384 | }
385 |
386 | clearosurl () {
387 | mirror="https://www.clearos.com/products/purchase/clearos-downloads"
388 | one=$(curl -s $mirror | grep -m1 ".iso\"")
389 | two=${one%.iso*}
390 | two=${two#*http://}.iso
391 | link="https://$two"
392 | new=$(curl -s "$link" | grep window.open | awk -F\' '{ print $2 }')
393 | #new="$(cat ClearOS*iso | grep -m1 .iso | awk -F\' '{ print $2 }')"
394 | output_path "clearos.iso"
395 | #rm ${two#*http://}.iso
396 | notlive
397 | checkfile $1
398 | }
399 |
400 | almaurl () {
401 | mirror="https://mirrors.almalinux.org"
402 | x=$(curl -s "$mirror/isos.html" | grep x86_64 | tail -1 | awk -F"\"" '{ print $2 }')
403 | one=$(curl -s "$mirror/$x" | grep iso | wc -l)
404 | two=$(( $RANDOM % $one + 1 ))
405 | three=$(curl -s "$mirror/$x" | grep iso | head -n$two | tail -1 | awk -F"\"" '{ print $2 }')
406 | four=$(curl -s "$three/" | grep -m1 dvd.iso | html2text | grep -m1 iso | awk -F"AlmaLinux" '{ print $2 }' | awk -F".iso" '{ print $1 }')
407 | new="$three/AlmaLinux$four.iso"
408 | output_path "alma.iso"
409 | checkfile $1
410 | }
411 |
412 | rockyurl () {
413 | mirror="https://rockylinux.org/download"
414 | new=$(curl -s $mirror | html2text | grep -m1 DVD | awk -F'(' '{ print $2 }' | awk -F')' '{ print $1 }')
415 | output_path "rocky.iso"
416 | checkfile $1
417 | }
418 |
419 | qubesurl () {
420 | mirror="https://www.qubes-os.org/downloads/"
421 | new=$(curl -s $mirror | grep -m1 x86_64.iso | awk -F"\"" '{ print $4 }')
422 | output_path "qubes.iso"
423 | checkfile $1
424 | }
425 |
426 | nobaraurl () {
427 | mirror="https://nobaraproject.org/download-nobara/"
428 | new=$(curl -s $mirror | grep -m1 "NA Download" | awk -F"\"" '{ print $8 }')
429 | output_path "nobara.iso"
430 | checkfile $1
431 | }
432 |
433 | ultraurl () {
434 | mirror="https://ultramarine-linux.org/download/"
435 | new=$(curl -s $mirror | grep -m1 "Download Flagship" | awk -F"\"" '{ print $14 }')
436 | output_path "ultramarine.iso"
437 | checkfile $1
438 | }
439 |
440 | springurl () {
441 | mirror="https://springdale.math.ias.edu/#Mirrors"
442 | new=$(curl -s $mirror | grep -m1 "/boot.iso" | awk -F"\"" '{ print $4 }')
443 | output_path "springdale.iso"
444 | checkfile $1
445 | }
446 |
447 | berryurl () {
448 | mirror="https://berry-lab.net/edownload.html"
449 | new=$(curl -s $mirror | grep -m1 .iso | awk -F"\"" '{ print $2 }')
450 | output_path "berry.iso"
451 | checkfile $1
452 | }
453 |
454 | risiurl () {
455 | mirror="https://risi.io/downloads"
456 | new=$(curl -s $mirror | grep Download | grep -m1 .iso | awk -F"\"" '{ print $2 }')
457 | output_path "risios.iso"
458 | checkfile $1
459 | }
460 |
461 | eurourl () {
462 | mirror="https://fbi.cdn.euro-linux.com/isos/"
463 | x=$(curl -s $mirror | grep latest.iso | awk -F"\"" '{ print $2 }')
464 | new="$mirror$x"
465 | output_path "eurolinux.iso"
466 | checkfile $1
467 | }
468 |
469 | alpineurl () {
470 | mirrorone="https://alpinelinux.org/downloads/"
471 | one=$(curl -s $mirrorone | grep Current | awk -F">" '{ print $3 }' | awk -F"<" '{ print $1 }')
472 | shortv=$(echo $one | awk -F"." '{ print $1"."$2}')
473 | x="http://dl-cdn.alpinelinux.org/alpine/v$shortv/releases/x86_64/alpine-extended-$one-x86_64.iso"
474 | new="$x"
475 | output_path "alpine.iso"
476 | checkfile $1
477 | }
478 |
479 | tinycoreurl () {
480 | mirrorone="http://tinycorelinux.net/downloads.html"
481 | one=$(curl -s $mirrorone | grep TinyCore-current.iso | awk -F\" '{ print $2 }')
482 | mirror="http://tinycorelinux.net/"
483 | new="$mirror/$one"
484 | output_path "tinycore.iso"
485 | checkfile $1
486 | }
487 |
488 | porteusurl () {
489 | mirrorone="https://porteus-kiosk.org/download.html"
490 | one=$(curl -s $mirrorone | grep "Porteus-Kiosk.*x86_64.iso" | grep -m1 public| awk -F\" '{ print $2 }')
491 | mirror="https://porteus-kiosk.org/"
492 | new="$mirror/$one"
493 | output_path "porteus.iso"
494 | checkfile $1
495 | }
496 |
497 | slitazurl () {
498 | x="http://mirror.slitaz.org/iso/rolling/slitaz-rolling-core64.iso"
499 | new="$x"
500 | output_path "slitaz.iso"
501 | checkfile $1
502 | }
503 |
504 | pclinuxosurl () {
505 | mirror="http://ftp.nluug.nl/pub/os/Linux/distr/pclinuxos/pclinuxos/live-cd/64bit/"
506 | x="pclinuxos$(curl -s $mirror | grep -m1 .iso | awk -F"pclinuxos" '{ print $2 }' | awk -F\" '{ print $1 }')"
507 | new="$mirror$x"
508 | output_path "pclinuxos.iso"
509 | checkfile $1
510 | }
511 |
512 | voidurl () {
513 | mirror="https://alpha.de.repo.voidlinux.org/live/current/"
514 | x=$(curl -s $mirror | grep "live" | grep -m1 "x86_64" | awk -F">" '{ print $2 }' | awk -F"<" '{ print $1 }')
515 | new="$mirror/$x"
516 | output_path "void.iso"
517 | checkfile $1
518 | }
519 |
520 | fourmurl () {
521 | mirror="https://sourceforge.net/projects/linux4m/files/latest/download"
522 | new="$mirror"
523 | output_path "4mlinux.iso"
524 | checkfile $1
525 | }
526 |
527 | kaosurl () {
528 | mirror="https://sourceforge.net/projects/kaosx/files/latest/download"
529 | new="$mirror"
530 | output_path "kaos.iso"
531 | checkfile $1
532 | }
533 |
534 | clearurl () {
535 | mirror="https://clearlinux.org/downloads"
536 | x=$(curl -s $mirror | grep live | grep -m1 iso | awk -F\" '{ print $2 }')
537 | new="$x"
538 | output_path "clearlinux.iso"
539 | checkfile $1
540 | }
541 |
542 | dragoraurl () {
543 | mirror="http://rsync.dragora.org/current/iso/beta/"
544 | echo "Unfortunately, current Dragora mirror ($mirror) is unavailable"
545 | #x=$(curl -s $mirror | grep -m1 x86_64 | awk -F\' '{ print $2 }')
546 | #new="$mirror$x"
547 | #output_path "dragora.iso"
548 | #checkfile $1
549 | }
550 |
551 | slackwareurl () {
552 | mirror="https://mirrors.slackware.com/slackware/slackware-iso/"
553 | x=$(curl -s $mirror | grep slackware64 | tail -1 | awk -F"slack" '{ print $2 }' | awk -F"/" '{ print $1 }')
554 | other="slack$x"
555 | y=$(curl -s "$mirror/$other/" | grep dvd.iso | head -1 | awk -F"slack" '{ print $2 }' | awk -F\" '{ print $1 }')
556 | new="$mirror"; new+="$other"; new+="/slack"; new+="$y"
557 | echo "new=$new"
558 | output_path "slackware.iso"
559 | checkfile $1
560 | }
561 |
562 | adelieurl () {
563 | mirror="https://www.adelielinux.org/download/"
564 | x=$(curl -s $mirror | html2text | grep "Listing]" | awk -F"(" '{ print $2 }' | awk -F")" '{ print $1 }')
565 | y=$(curl -s $x | grep live-mate | grep -m1 "x86_64" | awk -F"\"" '{ print $2 }')
566 | new="$x$y"
567 | output_path "adelie.iso"
568 | checkfile $1
569 | }
570 |
571 | plopurl () {
572 | mirror="https://www.plop.at/en/ploplinux/downloads/full.html"
573 | x="$(curl -s $mirror | grep x86_64.iso | head -1 | awk -F"https://" '{ print $2 }' | awk -F".iso" '{ print $1 }')"
574 | new="https://$x.iso"
575 | output_path "plop.iso"
576 | checkfile $1
577 | }
578 |
579 | solusurl () {
580 | mirror="https://getsol.us/download/"
581 | echo "Unfortunately, current Solus mirror ($mirror) is unavailable"
582 | #x=$(curl -s $mirror | grep -m1 iso | awk -F\" '{ print $2 }')
583 | #new="$x"
584 | #output_path "solus.iso"
585 | #checkfile $1
586 | }
587 |
588 | peropesisurl () {
589 | mirror="https://peropesis.org"
590 | mirror2="$mirror/get-peropesis/"
591 | x=$(curl -s $mirror2 | grep -m1 "live.iso" | awk -F"\"" '{ print $8 }')
592 | new="$mirror$x"
593 | output_path "peropesis.iso"
594 | checkfile $1
595 | }
596 |
597 | openmambaurl () {
598 | mirror="https://openmamba.org/en/downloads/"
599 | new=$(curl -s $mirror | grep "rolling livedvd" | awk -F"href" '{ print $2 }' | awk -F"\"" '{ print $2 }')
600 | output_path "openmamba.iso"
601 | checkfile $1
602 | }
603 |
604 | pisiurl () {
605 | new="https://sourceforge.net/projects/pisilinux/files/latest/download"
606 | output_path "pisi.iso"
607 | checkfile $1
608 | }
609 |
610 | ###################################
611 |
612 | gentoourl () {
613 | mirror="https://gentoo.c3sl.ufpr.br//releases/amd64/autobuilds"
614 | one=$(curl -s "$mirror/latest-iso.txt" | grep "admin" | awk '{ print $1 }')
615 | new="$mirror/$one"
616 | output_path "gentoo.iso"
617 | notlive
618 | checkfile $1
619 | }
620 |
621 | sabayonurl () {
622 | mirror="https://www.sabayon.org/desktop/"
623 | echo "Unfortunately, current Sabayon mirror ($mirror) is unavailable"
624 | #x=$(curl -s $mirror | grep GNOME.iso | head -1 | awk -F"http://" '{ print $2 }' | awk -F\" '{ print $1 }')
625 | #new="http://$x"
626 | #output_path "sabayon.iso"
627 | #checkfile $1
628 | }
629 |
630 | calcurl () {
631 | mirror="http://mirror.yandex.ru/calculate/nightly/"
632 | x=$(curl -s $mirror | grep "" '{ print $2 }' | awk -F"<" '{ print $1 }')
633 | mirror+=$x
634 | x=$(curl -s $mirror | grep -m1 cldc | awk -F\" '{ print $2 }')
635 | new="$mirror$x"
636 | output_path "calculate.iso"
637 | checkfile $1
638 | }
639 |
640 | nixurl () {
641 | mirror="https://channels.nixos.org/nixos-unstable"
642 | saved=$(curl -sL $mirror)
643 | dir=$(echo $saved | awk -F"nixos" '{ print $26 }')
644 | file=$(echo $saved | awk -F"nixos" '{ print $28 }' | awk -F".iso" '{ print $1 }')
645 | result="nixos"; result+=$dir; result+="nixos"; result+=$file
646 | x="https://releases.nixos.org/nixos/unstable/$result.iso"
647 | new="$x"
648 | output_path "nixos.iso"
649 | notlive
650 | checkfile $1
651 | }
652 |
653 | guixurl () {
654 | mirror="https://guix.gnu.org/en/download/"
655 | x=$(curl -s $mirror | grep ".iso" | awk -F"https://" '{ print $2 }' | awk -F\" '{ print $1 }')
656 | new="https://$x"
657 | output_path "guix.iso.xz"
658 | notlive
659 | checkfile $1
660 | [ -f "guix.iso" ] && echo "Please wait, unpacking guix..." && xz -k -d -v ./guix*xz && mv guix*iso guix.iso
661 | }
662 |
663 | cruxurl () {
664 | mirror="http://ftp.morpheus.net/pub/linux/crux/latest/iso/"
665 | x=$(curl -s $mirror | grep iso | grep href | awk -F"\"" '{ print $6 }' | awk -F"\"" '{ print $1 }')
666 | new="$mirror$x"
667 | output_path "crux.iso"
668 | checkfile $1
669 | }
670 |
671 | gobourl () {
672 | mirror="https://api.github.com/repos/gobolinux/LiveCD/releases/latest"
673 | new=$(curl -s $mirror | grep browser_download_url | grep x86_64.iso | awk -F"\"" '{ print $4 }')
674 | output_path "gobolinux.iso"
675 | checkfile $1
676 | }
677 |
678 | easyurl () {
679 | mirror="https://distro.ibiblio.org/easyos/amd64/releases/dunfell/2023/"
680 | x=$(curl -s $mirror | grep "Directory<" | tail -1 | awk -F "\"" '{ print $6 }')
681 | y=$(curl -s $mirror$x | grep img | awk -F"\"" '{ print $4 }')
682 | new="$mirror$x$y"
683 | output_path "easyos.img"
684 | checkfile $1
685 | }
686 |
687 | ####################################
688 |
689 | rancherurl () {
690 | mirror="https://api.github.com/repos/rancher/os/releases/latest"
691 | new=$(curl -s $mirror | grep browser_download_url | grep rancheros.iso | awk -F"\"" '{ print $4 }')
692 | output_path "rancheros.iso"
693 | checkfile $1
694 | }
695 |
696 | k3osurl () {
697 | mirror="https://api.github.com/repos/rancher/k3os/releases/latest"
698 | new=$(curl -s $mirror | grep browser_download_url | grep k3os-amd64.iso | awk -F"\"" '{ print $4 }')
699 | output_path "k3os.iso"
700 | checkfile $1
701 | }
702 |
703 | flatcarurl () {
704 | mirror="https://alpha.release.flatcar-linux.net/amd64-usr/current/flatcar_production_iso_image.iso"
705 | new="$mirror"
706 | output_path "flatcar.iso"
707 | checkfile $1
708 | }
709 |
710 | silverblueurl () {
711 | mirror="https://silverblue.fedoraproject.org/download"
712 | x=$(curl -s $mirror | grep -m1 x86_64 | awk -F\' '{ print $2 }')
713 | new="$x"
714 | output_path "silverblue.iso"
715 | checkfile $1
716 | }
717 |
718 | photonurl () {
719 | mirror="https://github.com/vmware/photon/wiki/Downloading-Photon-OS"
720 | x=$(curl -s $mirror | grep -m1 "Full ISO" | awk -F\" '{ print $2 }')
721 | new="$x"
722 | output_path "photonos.iso"
723 | notlive
724 | checkfile $1
725 | }
726 |
727 | coreosurl () {
728 | mirror="https://builds.coreos.fedoraproject.org/streams/next.json"
729 | x=$(curl -s $mirror | grep iso | grep -m1 location | awk -F\" '{ print $4 }')
730 | new="$x"
731 | output_path "coreos.iso"
732 | checkfile $1
733 | }
734 |
735 | dcosurl () {
736 | new="https://downloads.dcos.io/dcos/stable/dcos_generate_config.sh"
737 | output_path "dcos_generate_config.sh"
738 | echo "Warning! This is not an ISO or disk image, but rather a OS generator tool. After downloading, run chmod +x ./dc*sh"
739 | checkfile $1
740 | }
741 |
742 | freebsdurl () {
743 | mirror="https://www.freebsd.org/where/"
744 | x=$(curl -s $mirror | grep -m1 "amd64/amd64" | awk -F\" '{ print $2 }')
745 | one=$(curl -s $x | grep -m1 dvd1 | awk -F"FreeBSD" '{ print $2 }' | awk -F\" '{ print $1 }')
746 | new=$x; new+="FreeBSD"; new+=$one;
747 | output_path "freebsd.iso"
748 | notlinux
749 | checkfile $1
750 | }
751 |
752 | netbsdurl () {
753 | mirror="https://www.netbsd.org/"
754 | #mirror="https://wiki.netbsd.org/ports/amd64/"
755 | new=$(curl -s $mirror | grep -m1 "CD" | awk -F\" '{ print $4 }')
756 | output_path "netbsd.iso"
757 | notlinux
758 | checkfile $1
759 | }
760 |
761 | openbsdurl () {
762 | mirror="https://www.openbsd.org/faq/faq4.html"
763 | new=$(curl -s $mirror | grep -m1 -e 'iso.*amd64' | awk -F\" '{ print $2 }')
764 | output_path "openbsd.iso"
765 | notlinux
766 | checkfile $1
767 | }
768 |
769 | ghostbsdurl () {
770 | mirror="http://download.fr.ghostbsd.org/development/amd64/latest/"
771 | x=$(curl -s -L $mirror | grep ".iso<" | tail -1 | awk -F\" '{ print $2 }')
772 | new="$mirror$x"
773 | output_path "ghostbsd.iso"
774 | notlinux
775 | checkfile $1
776 | }
777 |
778 | hellosystemurl () {
779 | #mirror="https://github.com/helloSystem/ISO/releases/download/r0.5.0/hello-0.5.0_0E223-FreeBSD-12.2-amd64.iso"
780 | #mirror="https://github.com/helloSystem/ISO/releases/latest"
781 | #x=$(curl -s -L $mirror | grep FreeBSD | grep -m1 iso | awk -F\" '{ print $2 }')
782 | #new="https://github.com$x"
783 | mirror="https://api.github.com/repos/helloSystem/ISO/releases/latest"
784 | new=$(curl -s $mirror | grep browser_download_url | grep -m1 amd64.iso | awk -F"\"" '{ print $4 }')
785 | output_path "hellosystem.iso"
786 | notlinux
787 | checkfile $1
788 | }
789 |
790 | dragonurl () {
791 | mirror="https://www.dragonflybsd.org/download/"
792 | new=$(curl -s $mirror | grep "Uncompressed ISO:" | awk -F"\"" '{ print $2 }')
793 | output_path "dragonflybsd.iso"
794 | notlinux
795 | checkfile $1
796 | }
797 |
798 | pfsenseurl () {
799 | mirror="https://atxfiles.netgate.com/mirror/downloads/"
800 | x=$(curl -s $mirror | grep "amd64.iso.gz" | tail -1 | awk -F"\"" '{ print $2 }')
801 | new="$mirror$x"
802 | output_path "pfsense.iso.gz"
803 | if [ "$1" == "filesize" ]; then
804 | notlinux
805 | getsize
806 | else
807 | [ ! -f $output ] && wgetcmd && echo "Please wait, unpacking pfSense..." && gzip -d $output || echo "pfSense already downloaded."
808 | fi
809 | }
810 |
811 | opnsenseurl () {
812 | mirror="https://mirror.terrahost.no/opnsense/releases/"
813 | x=$(curl -s $mirror | grep -B1 mirror | head -1 | awk -F"\"" '{ print $2 }')
814 | y=$(curl -s $mirror$x | grep -m1 dvd | awk -F"\"" '{ print $2 }')
815 | new="$mirror$x$y"
816 | output_path "opnsense.iso.bz2"
817 | if [ "$1" == "filesize" ]; then
818 | notlinux
819 | getsize
820 | else
821 | [ ! -f $output ] && wgetcmd && echo "Please wait, unpacking opnsense..." && bzip2 -k -d $output && rm $output || echo "OpnSense already downloaded."
822 | fi
823 | }
824 |
825 | midnightbsdurl () {
826 | mirror="https://discovery.midnightbsd.org/releases/amd64/ISO-IMAGES/"
827 | x=$(curl -s $mirror | grep href | tail -1 | awk -F"\"" '{ print $2 }')
828 | y=$(curl -s $mirror$x | grep disc1.iso | awk -F"\"" '{ print $2 }')
829 | new="$mirror$x$y"
830 | output_path "midnightbsd.iso"
831 | notlinux
832 | checkfile $1
833 | }
834 |
835 | truenasurl () {
836 | mirror="https://www.truenas.com/download-truenas-core/"
837 | new=$(curl -s $mirror | grep -m1 iso | awk -F"\"" '{ print $6 }')
838 | output_path "truenas.iso"
839 | notlinux
840 | checkfile $1
841 | }
842 |
843 | nomadbsdurl () {
844 | mirror="https://nomadbsd.org/download.html"
845 | new=$(curl -s $mirror | grep -A2 "Main site" | grep -m1 img.lzma | awk -F"\"" '{ print $2 }')
846 | output_path "nomadbsd.img.lzma"
847 | if [ "$1" == "filesize" ]; then
848 | notlinux
849 | getsize
850 | else
851 | [[ ! -f $output && ! -f "nomadbsd.img" ]] && wgetcmd && echo "Please wait, unpacking NomadBSD..." && lzma -d $output || echo "NomadBSD already downloaded."
852 | fi
853 | }
854 |
855 | hardenedbsdurl () {
856 | new="https://installers.hardenedbsd.org/pub/current/amd64/amd64/installer/LATEST/disc1.iso"
857 | output_path "hardenedbsd.iso"
858 | notlinux
859 | checkfile $1
860 | }
861 |
862 | xigmanasurl () {
863 | new="https://sourceforge.net/projects/xigmanas/files/latest/download"
864 | output_path "xigmanas.iso"
865 | notlinux
866 | checkfile $1
867 | }
868 |
869 | clonosurl () {
870 | mirror="https://clonos.convectix.com/download.html"
871 | new=$(curl -s $mirror | grep .iso | awk -F"\"" '{ print $2 }')
872 | output_path "clonos.iso"
873 | notlinux
874 | checkfile $1
875 | }
876 |
877 | ## Not Linux
878 |
879 | indianaurl () {
880 | mirror="https://www.openindiana.org/download/"
881 | x=$(curl -s $mirror | grep "Live DVD" | awk -F"http://" '{ print $2 }' | awk -F\" '{ print $1 }')
882 | new="http://$x"
883 | output_path "openindiana.iso"
884 | notlinux
885 | checkfile $1
886 | }
887 |
888 | minixurl () {
889 | mirror="https://wiki.minix3.org/doku.php?id=www:download:start"
890 | x=$(curl -s $mirror | grep -m1 iso.bz2 | awk -F"http://" '{ print $2 }' | awk -F\" '{ print $1 }')
891 | new="http://$x"
892 | output_path "minix.iso.bz2"
893 | if [ "$1" == "filesize" ]; then
894 | notlinux
895 | notlive
896 | getsize
897 | else
898 | [ ! -f $output ] && wgetcmd && echo "Please wait, unpacking minix..." && bzip2 -k -d $output || echo "Minix already downloaded."
899 | fi
900 | }
901 |
902 | haikuurl () {
903 | mirror="https://download.haiku-os.org/nightly-images/x86_64/"
904 | x=$(curl -s $mirror | grep -m1 zip | awk -F\" '{ print $2 }')
905 | new="$x"
906 | output_path "haiku.zip"
907 | if [ "$1" == "filesize" ]; then
908 | notlinux
909 | getsize
910 | else
911 | [ ! -f $output ] && wgetcmd && echo "Please wait, unzipping haiku..." && unzip $output && rm ReadMe.md && mv haiku*iso haiku.iso || echo "Haiku already downloaded."
912 | fi
913 | }
914 |
915 | menueturl () {
916 | mirror="http://www.menuetos.be/download.php?CurrentMenuetOS"
917 | new="$mirror"
918 | output_path "menuetos.zip"
919 | if [ "$1" == "filesize" ]; then
920 | notlinux
921 | getsize
922 | else
923 | [ ! -f $output ] && wgetcmd && echo "Wait, unzipping menuetos..." && unzip $output && mv M64*.IMG menuetos.img || echo "Menuet already downloaded."
924 | fi
925 | }
926 |
927 | kolibriurl () {
928 | new="https://builds.kolibrios.org/eng/latest-iso.7z"
929 | output="kolibrios.7z"
930 | if [ "$1" == "filesize" ]; then
931 | notlinux
932 | getsize
933 | else
934 | [[ ! -f $output && ! -f "kolibri.iso" ]] && wgetcmd && echo "Un7zipping kolibri..." && 7z x $output && sleep 7 && rm $output && rm "INSTALL.TXT" || echo "Kolibri already downloaded."
935 | fi
936 | }
937 |
938 | reactosurl () {
939 | new="https://sourceforge.net/projects/reactos/files/latest/download"
940 | output_path "reactos.zip"
941 | if [ "$1" == "filesize" ]; then
942 | notlinux
943 | getsize
944 | else
945 | [[ ! -f $output && ! -f "reactos.iso" ]] && wgetcmd && echo "Please wait, unzipping reactos..." && unzip $output && mv React*iso reactos.iso || echo "ReactOS already downloaded."
946 | fi
947 | }
948 |
949 | freedosurl () {
950 | #mirror="https://sourceforge.net/projects/freedos/files/latest/download"
951 | #mirror="https://www.freedos.org/download/download/FD12CD.iso"
952 | mirror="https://www.freedos.org/download/"
953 | new=$(curl -s $mirror | grep FD13-LiveCD.zip | awk -F"\"" '{ print $2 }')
954 | output_path "freedos.zip"
955 | if [ "$1" == "filesize" ]; then
956 | notlinux
957 | getsize
958 | else
959 | [[ ! -f $output && ! -f "freedos.img" ]] && wgetcmd && echo "Please wait, unzipping FreeDOS..." && unzip $output && sleep 10 && rm $output && rm readme.txt && mv FD13BOOT.img freedos.img && mv FD13LIVE.iso freedos.iso || echo "FreeDOS already downloaded."
960 | fi
961 | }
962 |
963 | netbootxyz () {
964 | mirror="https://boot.netboot.xyz/ipxe/netboot.xyz.iso"
965 | new="$mirror"
966 | output_path "netboot.xyz.iso"
967 | checkfile $1
968 | }
969 |
970 | netbootsal () {
971 | mirror="http://boot.salstar.sk/ipxe/ipxe.iso"
972 | new="$mirror"
973 | output_path "ipxe.iso"
974 | checkfile $1
975 | }
976 |
977 | # this one is currently broken
978 | netbootipxe () {
979 | #mirror="http://cloudboot.nchc.org.tw/cloudboot/cloudboot_img/cloudboot_1.0.iso"
980 | mirror="http://boot.ipxe.org/ipxe.iso"
981 | new="$mirror"
982 | output_path "bootipxe.iso"
983 | checkfile $1
984 | }
985 |
986 | tailsurl () {
987 | mirror="https://mirrors.edge.kernel.org/tails/stable/"
988 | version=$(curl -s $mirror | grep -o 'tails-amd64-[0-9.]*' | head -n1)
989 | x="https://mirrors.edge.kernel.org/tails/stable/${version}/${version}.img"
990 | new="$x"
991 | output_path "tailsos.img"
992 | checkfile $1
993 | }
994 |
995 | proxmoxurl () {
996 | mirror="https://enterprise.proxmox.com/iso/"
997 | filename=$(curl -s $mirror | grep proxmox-ve | tail -1 | awk -F"\"" '{ print $2 }')
998 | new="${mirror}${filename}"
999 | output_path "proxmox.iso"
1000 | checkfile $1
1001 | }
--------------------------------------------------------------------------------
/download.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | helpsection () {
4 | echo "/----------------------------------------------------------------------------------------------------------------------------------------\ "
5 | echo "| Script downloads recent (latest release) linux ISOs and spins a VM for a test. This is kinda distrohopper dream machine. | "
6 | echo "| It consist of the file with distro download functions (distrofunctions.sh) as well as this script (download.sh). | "
7 | echo "| Theoretically, the script should always download recent linux ISOs without any updates. But, if the developer(s) | "
8 | echo "| change the download URL or something else, it might be required to do manual changes - probably in distrofunctions.sh. | "
9 | echo "| Requirements: linux, bash, curl, wget, awk, grep, xargs, pr (these tools usually are preinstalled on linux) | "
10 | echo "| Some distros are shared as archive. So you'll need xz for guix, bzip2 for minix, zip for haiku & reactos, and, finally 7z for kolibri. | "
11 | echo "| Written by SecurityXIII / Aug 2020 ~ Jan 2023 / Kopimi un-license /--------------------------------------------------------------------/ "
12 | echo "\-------------------------------------------------------------------/"
13 | echo "+ How to use?"
14 | echo " If you manually pick distros (opt. one or two) you will be prompted about launching a VM for test spin for each distro."
15 | echo " Multiple values are also supported. Please choose one out of five options:"
16 | echo "* one distribution (e.g. type 0 for archlinux)*"
17 | echo "* several distros - space separated (e.g. for getting both Arch and Debian, type '0 4' (without quotes))*"
18 | echo "* 'all' option, the script will ONLY download ALL of the ISOs (warning: this can take a lot of space (100+GB) !)"
19 | echo "* 'filesize' option will check the local (downloaded) filesizes of ISOs vs. the current/recent ISOs filesizes on the websites"
20 | echo "* 'netbootxyz' option allows you to boot from netboot.xyz via network"
21 | echo "* 'netbootsal' option will boot from boot.salstar.sk"
22 | }
23 |
24 | # the public ipxe mirror does not work
25 | #echo "* 'netbootipxe' option will boot from boot.ipxe.org"
26 |
27 | # NB: I wanted to add ElementaryOS but the developers made it way too hard to implement auto-downloading.
28 | # If you can find constant mirror or place for actual release of ElementaryOS, please do a pull-request or just leave a comment.
29 |
30 | # "WIP". Todo: 1. Multiple architecture support;
31 | # 2. Multiple download mirror support;
32 |
33 | ram=1024 # Amount (mb) of RAM, for VM.
34 | cmd="qemu-system-x86_64" # The name of the qemu file to launch
35 |
36 | # Load the functions from distrofunctions.sh:
37 | . distrofunctions.sh
38 |
39 | # Categories
40 | arch=(archlinux manjaro arcolinux archbang parabola endeavour artix arco garuda rebornos archlabs namib obarun archcraft peux bluestar xerolinux)
41 | deb=(debian ubuntu linuxmint zorinos popos deepin mxlinux knoppix kali puppy pureos elementary backbox devuan jingos cutefishos parrot tailsos)
42 | rpm=(fedora centos opensuse rosa altlinux mandriva mageia clearos alma rocky qubes nobara ultramarine springdale berry risios eurolinux)
43 | other=(alpine tinycore porteus slitaz pclinuxos void fourmlinux kaos clearlinux dragora slackware adelie plop solus peropesis openmamba pisi)
44 | sourcebased=(gentoo sabayon calculate nixos guix crux gobolinux easyos)
45 | containers=(rancheros k3os flatcar silverblue photon coreos dcos proxmox)
46 | bsd=(freebsd netbsd openbsd ghostbsd hellosystem dragonflybsd pfsense opnsense midnightbsd truenas nomadbsd hardenedbsd xigmanas clonos)
47 | notlinux=(openindiana minix haiku menuetos kolibri reactos freedos)
48 |
49 | # All distributions
50 | category_names=("Arch-based" "DEB-based" "RPM-based" "Other" "Source-based" "Containers and DCs" "BSD, NAS, Firewall" "Not linux")
51 | distro_all=("arch" "deb" "rpm" "other" "sourcebased" "containers" "bsd" "notlinux")
52 | distro_arr=("${arch[@]}" "${deb[@]}" "${rpm[@]}" "${other[@]}" "${sourcebased[@]}" "${containers[@]}" "${bsd[@]}" "${notlinux[@]}")
53 |
54 | # Legend ## Distroname ## Arch ## Type ## Download URL function name
55 |
56 | # Archlinux-based distros
57 | archlinux=("ArchLinux" "amd64" "rolling" "archurl")
58 | manjaro=("Manjaro" "amd64" "rolling" "manjarourl")
59 | arcolinux=("Arcolinux" "amd64" "rolling" "arcourl")
60 | archbang=("Archbang" "amd64" "rolling" "archbangurl")
61 | parabola=("Parabola" "amd64" "rolling" "parabolaurl")
62 | endeavour=("EendeavourOS" "amd64" "latest" "endeavoururl")
63 | artix=("ArtixLinux" "amd64" "daily" "artixurl")
64 | arco=("ArcoLinux" "amd64" "release" "arcourl")
65 | garuda=("Garuda" "amd64" "release" "garudaurl")
66 | rebornos=("RebornOS" "amd64" "release" "rebornurl")
67 | archlabs=("ArchLabs" "amd64" "release" "archlabsurl")
68 | namib=("Namib" "amd64" "release" "namiburl")
69 | obarun=("Obarun" "amd64" "rolling" "obarunurl")
70 | archcraft=("ArchCraft" "amd64" "release" "archcrafturl")
71 | peux=("Peux" "amd64" "release" "peuxurl")
72 | bluestar=("Bluestar" "amd64" "release" "bluestarurl")
73 | xerolinux=("XeroLinux" "amd64" "rolling" "xerourl")
74 |
75 | # Consider in the future if the distros continue to evolve
76 | # https://sourceforge.net/projects/calinixos/
77 | # https://sourceforge.net/projects/hefftorlinux/
78 |
79 | # Debian/Ubuntu-based distros
80 | debian=("Debian" "amd64" "testing" "debianurl")
81 | ubuntu=("Ubuntu" "amd64" "daily-live" "ubuntuurl")
82 | linuxmint=("LinuxMint" "amd64" "release" "minturl")
83 | zorinos=("ZorinOS" "amd64" "core" "zorinurl")
84 | popos=("PopOS" "amd64" "release" "popurl")
85 | deepin=("Deepin" "amd64" "release" "deepinurl")
86 | mxlinux=("MXLinux" "amd64" "release" "mxurl")
87 | knoppix=("Knoppix" "amd64" "release" "knoppixurl")
88 | kali=("Kali" "amd64" "kali-weekly" "kaliurl")
89 | puppy=("Puppy" "amd64" "bionicpup64" "puppyurl")
90 | pureos=("PureOS" "amd64" "release" "pureurl")
91 | elementary=("ElementaryOS" "amd64" "release" "elementurl")
92 | backbox=("Backbox" "amd64" "release" "backboxurl")
93 | devuan=("Devuan" "amd64" "beowulf" "devuanurl")
94 | jingos=("JingOS" "amd64" "v0.9" "jingosurl")
95 | cutefishos=("CutefishOS" "amd64" "release" "cutefishosurl")
96 | parrot=("Parrot" "amd64" "testing" "parroturl")
97 | tailsos=("Tailsos" "amd64" "stable" "tailsurl" )
98 |
99 | # Add if wanted
100 | # https://distrowatch.com/table.php?distribution=rebeccablackos
101 | # https://distrowatch.com/table.php?distribution=regata
102 | # https://distrowatch.com/table.php?distribution=uruk
103 | # https://distrowatch.com/table.php?distribution=netrunner
104 |
105 | # Fedora/RedHat-based distros
106 | fedora=("Fedora" "amd64" "Workstation" "fedoraurl")
107 | centos=("CentOS" "amd64" "stream" "centosurl")
108 | opensuse=("OpenSUSE" "amd64" "tumbleweed" "suseurl")
109 | rosa=("ROSA" "amd64" "desktop-fresh" "rosaurl")
110 | altlinux=("ALTLinux" "amd64" "release" "alturl")
111 | mandriva=("Mandriva" "amd64" "release" "mandrivaurl")
112 | mageia=("Mageia" "amd64" "cauldron" "mageiaurl")
113 | clearos=("ClearOS" "amd64" "release" "clearosurl")
114 | alma=("AlmaLinux" "amd64" "release" "almaurl")
115 | rocky=("RockyLinux" "amd64" "rc" "rockyurl")
116 | qubes=("QubesOS" "amd64" "release" "qubesurl")
117 | nobara=("Nobara" "amd64" "release" "nobaraurl")
118 | ultramarine=("Ultramarine" "amd64" "release" "ultraurl")
119 | springdale=("Springdale" "amd64" "release" "springurl")
120 | berry=("Berry" "amd64" "release" "berryurl")
121 | risios=("RisiOS" "amd64" "release" "risiurl")
122 | eurolinux=("EuroLinux" "amd64" "release" "eurourl")
123 |
124 | # Other distros
125 | alpine=("Alpine" "amd64" "extended" "alpineurl")
126 | tinycore=("TinyCore" "amd64" "current" "tinycoreurl")
127 | porteus=("Porteus" "amd64" "kiosk" "porteusurl")
128 | slitaz=("SliTaz" "amd64" "rolling" "slitazurl")
129 | pclinuxos=("PCLinuxOS" "amd64" "livecd" "pclinuxosurl")
130 | void=("Void" "amd64" "live" "voidurl")
131 | fourmlinux=("4mlinux" "amd64" "release" "fourmurl")
132 | kaos=("kaos" "amd64" "release" "kaosurl")
133 | clearlinux=("ClearLinux" "amd64" "release" "clearurl")
134 | dragora=("Dragora" "amd64" "release" "dragoraurl")
135 | slackware=("Slackware" "amd64" "current" "slackwareurl")
136 | adelie=("Adelie" "amd64" "rc1" "adelieurl")
137 | plop=("Plop" "amd64" "current-stable" "plopurl")
138 | solus=("Solus" "amd64" "release" "solusurl")
139 | peropesis=("Peropesis" "amd64" "live" "peropesisurl")
140 | openmamba=("Openmamba" "amd64" "rolling" "openmambaurl")
141 | pisi=("Pisilinux" "amd64" "release" "pisiurl")
142 |
143 | # Source-based distros
144 | gentoo=("Gentoo" "amd64" "admincd" "gentoourl")
145 | sabayon=("Sabayon" "amd64" "daily" "sabayonurl")
146 | calculate=("Calculate" "amd64" "release" "calcurl")
147 | nixos=("NixOS" "amd64" "unstable" "nixurl")
148 | guix=("Guix" "amd64" "release" "guixurl")
149 | crux=("CRUX" "amd64" "release" "cruxurl")
150 | gobolinux=("GoboLinux" "amd64" "release" "gobourl")
151 | easyos=("EasyOS" "amd64" "dunfell" "easyurl")
152 |
153 | # Distros for containers and data-centers
154 | rancheros=("RancherOS" "amd64" "release" "rancherurl")
155 | k3os=("K3OS" "amd64" "release" "k3osurl")
156 | flatcar=("Flatcar" "amd64" "release" "flatcarurl")
157 | silverblue=("Silverblue" "amd64" "release" "silverblueurl")
158 | photon=("PhotonOS" "amd64" "fulliso" "photonurl")
159 | coreos=("CoreOS" "amd64" "next" "coreosurl")
160 | dcos=("DC/OS" "amd64" "script" "dcosurl")
161 | proxmox=("Proxmox" "amd64" "stable" "proxmoxurl" )
162 |
163 | # FreeBSD family
164 | freebsd=("FreeBSD" "amd64" "release" "freebsdurl")
165 | netbsd=("NetBSD" "amd64" "release" "netbsdurl")
166 | openbsd=("OpenBSD" "amd64" "release" "openbsdurl")
167 | ghostbsd=("GhostBSD" "amd64" "release" "ghostbsdurl")
168 | hellosystem=("HelloSystem" "amd64" "v0.5" "hellosystemurl")
169 | dragonflybsd=("DragonflyBSD" "amd64" "release" "dragonurl")
170 | pfsense=("pfSense" "amd64" "release" "pfsenseurl")
171 | opnsense=("opnsense" "amd64" "release" "opnsenseurl")
172 | midnightbsd=("midnightbsd" "amd64" "release" "midnightbsdurl")
173 | truenas=("truenas" "amd64" "release" "truenasurl")
174 | nomadbsd=("nomadbsd" "amd64" "release" "nomadbsdurl")
175 | hardenedbsd=("hardenedbsd" "amd64" "latest" "hardenedbsdurl")
176 | xigmanas=("xigmanas" "amd64" "release" "xigmanasurl")
177 | clonos=("clonos" "amd64" "release" "clonosurl")
178 |
179 | # Add more FreeBSD stuff
180 | # https://en.wikipedia.org/wiki/List_of_BSD_operating_systems
181 | # https://en.wikipedia.org/wiki/List_of_products_based_on_FreeBSD
182 |
183 | # Not linux, but free
184 |
185 | # Add More Solaris stuff https://solaris.com
186 |
187 | openindiana=("OpenIndiana" "amd64" "release" "indianaurl")
188 | minix=("MINIX" "amd64" "release" "minixurl")
189 | haiku=("Haiku" "amd64" "nightly" "haikuurl")
190 | menuetos=("MenuetOS" "amd64" "release" "menueturl")
191 | kolibri=("Kolibri" "amd64" "release" "kolibriurl")
192 | reactos=("ReactOS" "amd64" "release" "reactosurl")
193 | freedos=("FreeDOS" "amd64" "release" "freedosurl")
194 |
195 | drawmenu () {
196 |
197 | q=0;
198 |
199 | for ((i=0; i<${#distro_all[@]}; i++)); do
200 | col+="${category_names[$i]}: \n"
201 | dist=${distro_all[$i]}
202 | typeset -n arr=$dist
203 | for ((d=0; d<${#arr[@]}; d++)); do
204 | col+="$q = ${arr[$d]} \n"
205 | (( q++ ));
206 | done
207 | printf "$col" > col$i.tmp
208 | col=""
209 | done
210 |
211 | pr -m -t -w170 col*tmp && rm *tmp
212 |
213 | }
214 |
215 | normalmode () {
216 | drawmenu
217 | echo "Please choose distro to download (type-in number or space-separated multiple numbers):"
218 | read x
219 |
220 | # Happens if the input is empty
221 | if [ -z "$x" ]; then echo "Empty distribution number. Please type-in number of according distro. Exiting"; exit; fi # "Empty" handling
222 |
223 | # Happens if we ask only for menu
224 | if [ "$x" = "menu" ]; then drawmenu; exit; fi
225 |
226 | # This questions are asked ONLY if user hadn't used the option "all".
227 | if [ "$x" != "all" ] && [ "$x" != "filesize" ] && [ "$x" != "netbootxyz" ] && [ "$x" != "netbootsal" ] && [ "$noconfirm" != "1" ] && [ "$x" != "netbootipxe" ]; then
228 | for distr in $x; do
229 | dist=${distro_arr[$distr]}
230 | typeset -n arr=$dist
231 |
232 | echo "You choose ${arr[0]} distro ${arr[2]}, built for ${arr[1]} arch. Do you want to download ${arr[0]} ISO? (y / n)"
233 | read z
234 | if [ $z = "y" ]; then $"${arr[3]}"; fi
235 | echo "${arr[0]} downloaded, do you want to spin up the QEMU? (y / n)"
236 | read z
237 |
238 | if [ $z = "y" ]; then
239 | isoname="$(echo ${arr[0]} | awk '{print tolower($0)}').iso"
240 | if ! type $cmd > /dev/null 2>&1; then
241 | echo "qemu seems not installed. Cannot run VM, skipping."
242 | else
243 | # Uncomment the following two rows (a1 & a2) and comment out others if you want to make QEMU HDD
244 | # qemu-img create ./${arr[0]}.img 4G # a1. Creating HDD (if you want changes to be preserved)
245 | # qemu-system-x86_64 -hda ./${arr[0]}.img -boot d -cdrom ./${arr[0]}*.iso -m 1024 # a2. Booting from CDROM with HDD support (changes will be preserved)
246 | [ -f ./$isoname ] && $cmd -boot d -cdrom ./$isoname -m $ram # b1. This is liveCD boot without HDD (all changes will be lost)
247 | # This is for floppy .IMG support
248 | # [ ! -f ./$isoname ] && imgname="$(echo ${arr[0]} | awk '{print tolower($0)}').img" && [ -f ./$imgname ] && $cmd --fda ./$imgname -m $ram
249 | [ ! -f ./$isoname ] && imgname="$(echo ${arr[0]} | awk '{print tolower($0)}').img" && [ -f ./$imgname ] && $cmd -drive format=raw,file=$imgname -m $ram
250 | fi
251 | fi
252 |
253 | done
254 | else
255 |
256 | # All handling: automatic download will happen if user picked "all" option, no questions asked.
257 | if [ "$x" = "all" ]; then
258 | for ((i=0; i<${#distro_arr[@]}; i++)); do xx+="$i "; done; x=$xx;
259 | #for ((i=0; i<${#distro_arr[@]}; i++)); do
260 | for distr in $x; do
261 | dist=${distro_arr[$distr]}
262 | typeset -n arr=$dist
263 | $"${arr[3]}"
264 | done
265 | #done
266 | fi
267 |
268 | if [ "$noconfirm" = "1" ]; then
269 | for distr in $x; do
270 | dist=${distro_arr[$distr]}
271 | typeset -n arr=$dist
272 | $"${arr[3]}"
273 | done
274 | #done
275 | fi
276 |
277 | # Sizecheck handling: show the distribution file sizes
278 | if [ "$x" = "filesize" ]; then
279 | for ((i=0; i<${#distro_arr[@]}; i++)); do xx+="$i "; done; x=$xx;
280 | #for ((i=0; i<${#distro_arr[@]}; i++)); do
281 | for distr in $x; do
282 | dist=${distro_arr[$distr]}
283 | typeset -n arr=$dist
284 | $"${arr[3]}" "filesize"
285 | done
286 | #done
287 | fi
288 |
289 | if [ "$x" = "netbootxyz" ]; then
290 | echo "Downloading netboot image from netboot.xyz, please wait..." && netbootxyz
291 | echo "Loading netboot.xyz.iso..." && $cmd -boot d -cdrom netboot.xyz.iso -m $ram
292 | fi
293 |
294 | if [ "$x" = "netbootsal" ]; then
295 | echo "Downloading netboot image from boot.salstar.sk, please wait..." && netbootsal
296 | echo "Loading ipxe.iso..." && $cmd -boot d -cdrom ipxe.iso -m $ram
297 | fi
298 |
299 | if [ "$x" = "netbootipxe" ]; then
300 | echo "Downloading netboot image from boot.ipxe.org, please wait..." && netbootipxe
301 | echo "Loading bootipxe.iso..." && $cmd -boot d -cdrom bootipxe.iso -m $ram
302 | fi
303 | fi
304 | }
305 |
306 | quickmode () {
307 | IFS=,
308 | for distr in $distros; do
309 | dist=${distro_arr[$distr]}
310 | typeset -n arr=$dist
311 | $"${arr[3]}"
312 | done
313 | exit 0;
314 | }
315 |
316 | VALID_ARGS=$(getopt -o hysod: --long help,noconfirm,silent,output_dir,distro: -- "$@")
317 | if [[ $? -ne 0 ]]; then
318 | exit 1;
319 | fi
320 |
321 | eval set -- "$VALID_ARGS"
322 | while [ : ]; do
323 | case "$1" in
324 | -h | --help)
325 | helpsection
326 | echo "Valid command line flags:"
327 | echo "-h/--help: Show this help"
328 | echo "-y/--noconfirm: Download specified distro without confirmation. "
329 | echo "-s/--silent: Don't show help or extra info."
330 | echo "-o/--output_dir: Path where the downloaded files will be stored."
331 | echo "-d/--distro: Download distributions specified in the comma-separated list. Example: 0,2,34"
332 | exit 0;
333 | ;;
334 | -y | --noconfirm)
335 | echo "-y/--noconfirm option specified. Script will download specified distro without confirmation."
336 | noconfirm=1
337 | shift
338 | ;;
339 | -s | --silent)
340 | echo "-s/--silent option specified. Script will not show help or extra info."
341 | silent=1
342 | shift
343 | ;;
344 | -o | --output_dir)
345 | echo "-o/--output_dir option specified. The images will be downloaded in \"$3\"."
346 | output_dir=$3
347 | shift
348 | ;;
349 | -d | --distro)
350 | echo "-d/--distro option specified. Script will download distributions with the following numbers: '$2'"
351 | distros="$2"
352 | quickmode
353 | ;;
354 | --) shift;
355 | break
356 | ;;
357 | esac
358 | done
359 |
360 | if [ "$silent" != "1" ]; then helpsection; fi
361 |
362 | normalmode
363 |
--------------------------------------------------------------------------------
|