make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / user-tools / wget-mirror
blob4704d7c5fe27b2599a226a5a0450ddcfb4939e60
1 #!/bin/bash
3 url=$1
4 shift
5 wget_args=("$@")
8 url_noproto=${url#*://}
9 url_noproto_nodomain_noleadingslash=${url_noproto#*/}
10 url_path_noleadingslash=${url_noproto_nodomain_noleadingslash%%\?*}
11 slashes=${url_path_noleadingslash//[!\/]}
12 depth=${#slashes}
15 exec wget --recursive --no-parent --timestamping --reject-regex='/(index\.html|)\?.+' --no-host-directories --cut-dirs=$depth "$url" "${wget_args[@]}"