knifegunaxe 0 Posted ... hi, I use this command to display the name of the connected server in bash: wget -q -O - '$@' https://airvpn.org | grep -e 'Connected to'| sed 's|^[^g]*g| |' | sed 's/<.*//' | sed s'| >||' It is working, but maybe someone can write it better... Quote Share this post Link to post
OpenSourcerer 1442 Posted ... Pull the userinfo API endpoint with curl, filter with jq. $ curl -H "API-KEY:…" "https://airvpn.org/api/userinfo/"|jq .connection.server_name API key is in your API settings. Quote Hide OpenSourcerer's signature Hide all signatures NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT. LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too! Want to contact me directly? All relevant methods are on my About me page. Share this post Link to post
knifegunaxe 0 Posted ... Thanks. Here is what I use now: curl --silent 'https://airvpn.org/api/whatismyip/' | grep server | sed 's|^[^\:]*\:| |' | sed 's|,||' | sed 's| ||' Quote Share this post Link to post
radolkin 0 Posted ... A possible alternative: curl -s 'https://airvpn.org/api/whatismyip/' | awk '{ FS = "\"" } /server/ { print $4 }' Quote Share this post Link to post
knifegunaxe 0 Posted ... or this using curl --silent: curl --silent -H "API-KEY:..." "https://airvpn.org/api/userinfo/" | jq .connection.server_name Quote Share this post Link to post