Skip to content

Instantly share code, notes, and snippets.

@nemesifier
Last active March 15, 2016 09:27
Show Gist options
  • Save nemesifier/b6cf61d99676f24f20f8 to your computer and use it in GitHub Desktop.
Save nemesifier/b6cf61d99676f24f20f8 to your computer and use it in GitHub Desktop.
Push OLSR data to django-netjsongraph
#!/bin/sh
BASE_URL="http://ninux-graph.netjson.org"
# put your network topology id here
UUID="<uuid>"
# put your network topology key here
KEY="<key>"
# host where OLSR is running
OLSR_HOST="127.0.0.1"
# port on which OLSR is listening, change it according to your configuration
OLSR_PORT="2006"
COLLECTOR_URL="$BASE_URL/api/receive/$UUID/?key=$KEY"
DATA=$(echo "GET /\n\n" | nc $OLSR_HOST $OLSR_PORT)
curl -s -X POST -d "$DATA" --header "Content-Type: text/plain" "$COLLECTOR_URL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment