Merge branch 'release', remote branch 'origin' into release

This commit is contained in:
Dhanya Maliakal 2016-02-02 10:48:15 +01:00
commit b27e42f193
2 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/bin/bash
STARTPORT=$1
AMOUNT=$2
if [ "$2" == "" ]; then
echo Syntax: $0 STARTPORT AMOUNT
echo Example: $0 1991 8 gives you 8 receivers starting with port 1991
fi
declare -A ARG
count=0
for i in `seq $STARTPORT $((STARTPORT+$((AMOUNT-1))))`; do
if [ "$((count%2))" == "0" ]; then
ARG[$count]="slsReceiver --rx_tcpport $i"
else
ARG[$count]="slsReceiver --rx_tcpport $i --mode 1"
fi
count=$((count+1))
done
xterms -k "${ARG[@]}"

42
examples/scripts/xterms Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# This script starts several xterms, one for each argument
# If the first argument is -k the script waits for you pressing Ctr-C and kills all started xterms afterwards.
#
# example:
# xterms "ls -lah; sleep 4" "runprogramm -f 2"
if [ "$1" == "-k" ]; then
DOKILL=1
shift
fi
LINE=0
COLUMN=-330
for i in `seq 1 $#`; do
COLUMN=$((COLUMN+$((i%2))*330))
echo xterm -g 50x20+${COLUMN}+${LINE} -e ${!i} &
xterm -g 50x20+${COLUMN}+${LINE} -e ${!i} &
PID[$i]=$!
LINE=$((i%2*330))
done
#for i in `seq 0 $(($#-1))`; do
# LINES=$(((i-i%4)/4))
# arg=$((i+1))
# xterm -g 50x20+$(((i%4)*330))+$((LINES*330)) -e ${!arg} &
# PID[$i]=$!
#done
if [ "$DOKILL" != "1" ]; then
exit
fi
while (true); do
read
done
for i in ${PID[@]}; do
kill $i
done