Skip to content

Instantly share code, notes, and snippets.

@vimagick
Created July 7, 2023 10:21
Show Gist options
  • Save vimagick/55abf4b9984d087fd8736a2f8dce1ebb to your computer and use it in GitHub Desktop.
Save vimagick/55abf4b9984d087fd8736a2f8dce1ebb to your computer and use it in GitHub Desktop.
#/bin/bash
#
# Device Listing in Linksys Smart Wi-Fi
#
IPADDR=x.x.x.x
PASSWD=********
ACTION=devicelist/GetDevices
curl -s -H 'Content-Type: application/json' -H "X-JNAP-Authorization: Basic $(echo -n "admin:$PASSWD" | base64)" -H "X-JNAP-Action: http://linksys.com/jnap/$ACTION" http://$IPADDR/JNAP/ -d '{}' |
jq -r '.output.devices[]|select(.connections[0].ipAddress)|"\(.connections[0].ipAddress)\t\(.friendlyName)"' |
nl -w3 -s $'.\t'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment