Created
October 26, 2012 21:48
-
-
Save elvisimprsntr/3961767 to your computer and use it in GitHub Desktop.
Bash script for the REST interface of Thinkflood's RedEye
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/bash | |
read -p "Enter RedEye IP address or hostname: " REIP | |
# define variables | |
RESTURL=http://$REIP:8080/redeye | |
RESTLOG=redeye_interrogate.log | |
# define function | |
restwget () { | |
wget -O $RESPLOG.xml ${RESTURL}${RESTCMD} >> ${RESTLOG} 2>&1 | |
} | |
echo "Begin RedEye REST interrogation" > ${RESTLOG} 2>&1 | |
# Device | |
RESTCMD=/ | |
RESPLOG=redeye_info | |
restwget | |
# Rooms | |
RESTCMD=/rooms/ | |
RESPLOG=redeye_rooms | |
restwget | |
# Devices | |
RESTCMD=/rooms/0/devices/ | |
RESPLOG=redeye_devices | |
restwget | |
# Commands | |
RESTCMD=/rooms/0/devices/2/commands/ | |
RESPLOG=redeye_commands | |
restwget | |
# Send Command | |
RESTCMD=/rooms/0/devices/2/commands/send?commandId=14 | |
RESPLOG=redeye_sendcommand | |
restwget | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment