searchCD, fastdu upgrade, whatismyip.. try out!
This commit is contained in:
23
web/whatismyip
Executable file
23
web/whatismyip
Executable 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
|
||||
|
||||
Reference in New Issue
Block a user