% GET-IP(1) Version 3.2.0 | Scripts Documentation % Georg Voell - georg.voell@standby.cloud % (c)2024 Standby.cloud NAME ==== **get-ip** - (BASH Script) Get the external ip of the instance and some more infos. It calls an external site via 'curl' to SYNOPSIS ======== | **get-ip** \[_options_] \[_keys_] DESCRIPTION =========== Get the external ip of the instance and some more infos. It calls an external site via 'curl' to get besides the external ip e.g. the ASN number back. If the instance uses an NAT geateway instead of an Internet gateway, toe tool returns the public IP of the NAT gateway. If there is no internet connection, the result would be empty. Options ------- -h, \--help          : Displays helptext. -v, \--version          : Displays the version of the script. -o, \--output _string_         : Output format: _string_ can be "plain" (default), "keys", "json", "etsv", "tsv", "line" or "table". Keys ------- Optional - Select the keys you want to display. Use a tab (default) or comma separated string for keys e.g.: ip          : Displays the IP e.g. "87.162.84.113". country         : Displays the Country e.g. "Germany". city          : Displays the City e.g. "Berlin". asn          : Displays the ASN ID e.g. "AS3320" for "Deutsche Telekom AG" or "AS31898" for "ORACLE-BMC / OCI" EXAMPLES ======== **get-ip** ip : Displays the External IP of the instance (returns empty string if there is no internet connection). **get-ip** \--output json : Displays all results in json format. **get-ip** \--output keys : Displays all results in key/value pair format. EXIT CODES ========== 01: Unknown or wrong parameter. 02: **curl** not found. This script needs **curl** to perform. 03: Key not found 04: No internet access. This script calls an external tool to get ip infos. 99: User interrupt. SEE ALSO ======== **check-port**(1), **get-platform**(1), **install-scripts**(1)