Skip to content

Instantly share code, notes, and snippets.

@danieltroger
Created March 31, 2015 12:18
Show Gist options
  • Select an option

  • Save danieltroger/d95913362cf1aa07a0a5 to your computer and use it in GitHub Desktop.

Select an option

Save danieltroger/d95913362cf1aa07a0a5 to your computer and use it in GitHub Desktop.
One-liner to get all active devices from thomsom router
#!/bin/bash
# The router localisation has to be swedish for this to work. You could surely even just replace "aktiv" with active but I ain't sure...
curl -s "http://192.168.1.254/cgi/b/devs/ov/" | grep -i aktiv | grep -vi inaktiv | grep -v web | awk ' { print $13 } ' | cut -c 12- | sed 's/<.*//' | sort | tr '\n' ', ' | rev | cut -c 2- | rev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment