Commit 22d2a342 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

added _send_backend_command to SCRIPTS in Roach component

parent 50e044a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ lllll_OBJECTS =
#
# Scripts (public and local)
# ----------------------------
SCRIPTS         =
SCRIPTS         = _send_backend_command
SCRIPTS_L       =

#
+37 −0
Original line number Diff line number Diff line
#!/bin/bash

#initialize default values
COMMAND=convert-data #this is for convenience 
SERVER=192.168.200.216 #should be roach backend at SRT
PORT=10000

#parsing command line arguments
while getopts "c:s:p:h" opt; do
    case "$opt" in 
        s)
            SERVER=$OPTARG
            ;;
        p)
            PORT=$OPTARG
            ;;
        c)
            COMMAND=$OPTARG
            ;;
        h)
            echo "Usage: 
    _send_backend_command [-c command] [-s SERVER.IP] [-p PORT] [-h]

    defaults: COMMAND convert-data
              SERVER  192.168.200.216
              PORT    10000
              
    A list of protocol commands and a description of the protocol can be found at:
    http://discos.readthedocs.org/en/latest/developer/protocols/backends.html"
            exit 0
            ;;
    esac
done

#executing
{ echo "?$COMMAND"; sleep 1; echo ""; echo "quit"; } | telnet $SERVER $PORT >/dev/null