The API server api-hsq93r is running with a Session Manager profile. A script on it needs to know its own addresses, without asking anyone outside.
- Keep the instance's id in
IDand start a session on it. - Inside, ask the metadata service for
instance-idwithout a token, withcurl -I, and read the status. - Fetch a token into
TOKEN. - With the token, save the instance's public IP to
/tmp/public-ip.txtand its private IP to/tmp/private-ip.txt, thenexit.