Skip to content

Instantly share code, notes, and snippets.

@leosamuele221
leosamuele221 / curlbuild.sh
Last active March 26, 2024 00:36
Automatic installer and builder for curl 8.6.0 in alpine 3.19 (includes dependecies for build)
#!/bin/bash
apk del curl &&
wget -q https://github.com/curl/curl/releases/download/curl-8_6_0/curl-8.6.0.tar.gz &&
tar -xf curl-8.6.0.tar.gz &&
cd curl-8.6.0 &&
apk add openssl-dev g++ make autoconf libpsl-dev &&
./configure --with-openssl &&
make && make install

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/

…and the options explained

  • -k : convert links to relative
  • -K : keep an original versions of files without the conversions made by wget
  • -E : rename html files to .html (if they don’t already have an htm(l) extension)
  • -r : recursive… of course we want to make a recursive copy
  • -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.