mirror of
https://github.com/rwxrob/dot
synced 2024-11-14 18:12:56 +00:00
20 lines
451 B
Bash
Executable File
20 lines
451 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# let's ping to make sure the VPN is up and the IP/host is good
|
|
|
|
url="$1"
|
|
|
|
if [[ -z "$url" ]];then
|
|
echo 'usage: kurl <url>'
|
|
fi
|
|
|
|
if [[ ! "$url" =~ ^http ]];then
|
|
url=http://$url
|
|
fi
|
|
|
|
useragent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0'
|
|
filename=${url//\/\//}
|
|
filename=${filename//\//-}
|
|
outfile="curl-$filename.out.$(date "+%s")"
|
|
curl -sv -A "$useragent" "$url" 2>&1 | tee "$outfile" | less -R
|