summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-01 14:28:15 +0200
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-06-01 14:28:15 +0200
commit36e6a347b7a6c07eaa285af828a9d5393043646b (patch)
tree9778d0cc1ffdb37a5f8d10c4066f6862f333000a
parentFixed usage message (diff)
downloadgeolocate-36e6a347b7a6c07eaa285af828a9d5393043646b.tar.gz
geolocate-36e6a347b7a6c07eaa285af828a9d5393043646b.tar.bz2
geolocate-36e6a347b7a6c07eaa285af828a9d5393043646b.zip
Added version command
-rwxr-xr-xgeolocate6
1 files changed, 6 insertions, 0 deletions
diff --git a/geolocate b/geolocate
index c96c91b..bf18073 100755
--- a/geolocate
+++ b/geolocate
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+VERSION=1.0
+
 # Check for an internet connection
 echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
 
@@ -22,6 +24,10 @@ usage() {
   echo -e "     ip 'IP'    - get coordinates of a non-personal ip."
 }
 
+version() {
+  echo ${VERSION}
+}
+
 getIp() {
   PUBLIC_IP=`curl -s https://ipinfo.io/ip`
   echo ${PUBLIC_IP}