Get Approximate Location Info - ipinfo.io - cURL - Universal TODO
Log In or Register to download the BES file, and more.

0 Votes

Description

without a paid account, the ipinfo api has limitations, so don't overload / overuse it.

Property Details

ID22465
StatusAlpha - Code that was just developed
TitleGet Approximate Location Info - ipinfo.io - cURL - Universal TODO
Download Size4
SourceInternal
Source IDjgstew
Source Release Date5/4/2016 12:00:00 AM
Is TaskTrue
Added by on 10/28/2016 12:02:46 PM
Last Modified by on 10/28/2016 12:10:06 PM
Counters 4347 Views / 83 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 1 fixlet   * Results in a true/false
Show indented relevance
not exists files whose(name of it as lowercase starts with "public_ip_http_curl_location_approximation.json" AND name of it as lowercase ends with ".json" AND (now - modification time of it) < 11*day ) of folders "Logs" of folders "__Global" of data folders of client
Used in 2 fixlets   * Results in a true/false
Show indented relevance
/* cURL exists */ (mac of operating system) OR ( /* if cURL is missing, it will be downloaded */ windows of operating system) OR ( exists files whose(name of it as lowercase = "curl" OR name of it as lowercase = "curl.exe") of (folders it) of unique values of (it as trimmed string) of substrings separated by (";";":") of values of (variables "PATH" of it; (if (windows of operating system) then (x64 variables "PATH" of it) else NOTHINGS) ) of environments )

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
// if Windows, then download prereqs.
begin prefetch block
    if { (windows of operating system) AND ( not exists files whose(name of it as lowercase = "curl" OR name of it as lowercase = "curl.exe") of (folders it) of unique values of (it as trimmed string) of substrings separated by (";";":") of values of (variables "PATH" of it; (if (windows of operating system) then (x64 variables "PATH" of it) else NOTHINGS) ) of environments ) }
        add prefetch item name=unzip.exe sha1=e1652b058195db3f5f754b7ab430652ae04a50b8 sha256=8d9b5190aace52a1db1ac73a65ee9999c329157c8e88f61a772433323d6b7a4a size=167936 url=http://software.bigfix.com/download/redist/unzip-5.52.exe
        add prefetch item name=7za.zip sha1=9ce9ce89ebc070fea5d679936f21f9dde25faae0 sha256=2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac size=384846 url=http://d.7-zip.org/a/7za920.zip
        add prefetch item name=curl.cab sha1=1d104ff75f52718709307ba03af0fcad17c1237a sha256=56bb84b3671b21fd41d497d88fba6cad72937312697423fa0fe7a3f1a37e0ad1 size=1435991 url=http://skanthak.homepage.t-online.de/download/curl-7.43.0.cab
    endif
end prefetch block

parameter "ProviderPublicIP" = "ipinfo.io"

if { (windows of operating system) AND ( not exists files whose(name of it as lowercase = "curl" OR name of it as lowercase = "curl.exe") of (folders it) of unique values of (it as trimmed string) of substrings separated by (";";":") of values of (variables "PATH" of it; (if (windows of operating system) then (x64 variables "PATH" of it) else NOTHINGS) ) of environments ) }
// set up use of `cURL`

// ADD TO UTILITY CACHE: unzip,7zip,curl
    utility __Download\unzip.exe
    utility __Download\7za.zip
    utility __Download\curl.cab

// EXTRACT using unzip: the 7zip command line utility
    waithidden __Download\unzip.exe -o "{ download path "7za.zip" }" 7za.exe -d "{ pathname of download folder }"

// EXTRACT using 7zip: CURL
    waithidden "{ download path "7za.exe" }" e -i!I386\Curl.EXE -y -o"{ pathname of parent folder of download folder }" "{ download path "curl.cab" }"
endif

wait curl {parameter "ProviderPublicIP"} -o "{pathname of folders "Logs" of folders "__Global" of data folders of client}{if windows of operating system then "\" else "/"}public_ip_http_curl_location_approximation.json"

// References:
// - http://ipinfo.io/developers
// - https://developers.google.com/maps/documentation/timezone/intro#Requests
// - https://developer.bigfix.com/action-script/reference/download/add-prefetch-item.html
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!