How to execute simple sh command and how to provide mock physical location?

I have test.sh :

from http://ipinfo.io/

#!/usr/bin/env bash
ip=$(curl ipinfo.io/city)
echo "My public IP address is: $ip"

My public IP address is: London

or how to execute shell scripts in MeteorJS in general so that I can return result back from shell command,

Secondly how to mock geolocation so how to provide mock physical location for testing?

frameworks like Mocha, Jasmine, Vow etc are able to provide mock geolocations?

I see this package :slight_smile:

https://www.npmjs.com/package/mock-geolocation

But just wondering how to use ipinfo.io with mock-geolocation as it doesn’t seem to allow Lat, Lon input?

thanks

1 Like

Really, the shell script isn’t necessary. You can just use the HTTP.call() function and grab the response.

As for #2, that site uses your IP address to get your location so in order to get it to return different results you would have to spoof your IP address. Not really sure what you’re trying to accomplish hear so it’s hard to really point you in the right direction.