searchCD, fastdu upgrade, whatismyip.. try out!

This commit is contained in:
Ville Rantanen
2017-04-26 09:06:06 +03:00
parent 4ea82390d1
commit 9f91ee1654
4 changed files with 70 additions and 10 deletions

23
web/whatismyip Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
function helpexit() {
echo "Print your public internet IP address."
echo "-n return as host name."
exit
}
for (( i=1; i<=$#; i++ )); do
[[ "${!i}" = "--help" ]] && helpexit
[[ "${!i}" = "-h" ]] && helpexit
[[ "${!i}" = "-n" ]] && { NAME=1; continue; }
done
IP=$( dig +short myip.opendns.com @resolver1.opendns.com )
if [[ "$NAME" -eq 1 ]]; then
dig +short -x "$IP"
else
echo $IP
fi