Skip to content

Instantly share code, notes, and snippets.

@gubi
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gubi/724d4eb08374443b1106 to your computer and use it in GitHub Desktop.
Save gubi/724d4eb08374443b1106 to your computer and use it in GitHub Desktop.
Get the topology map data from a Ninux device and send it to a remote server
<?php
header("Content-type: text/plain");
print $_POST["topology"];
?>
#!/bin/sh
# Your configuration data
source_device_uri="http://YOUR_DEVICE_URL:2006"
remote_server="YOUR_SERVER_URL/get_topology.php"
# Fetch the absolute curl position
curl=$(which curl)
# Ask the device for topology map and store output in a variable
topology=$($curl --silent ${source_device_uri})
# Send data to the remote server
query=$($curl --silent -X POST -d topology="${topology}" ${remote_server})
# SHow the output
echo "$query"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment