Last active
August 29, 2015 14:23
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Content-type: text/plain"); | |
print $_POST["topology"]; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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