diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2013-08-22 14:36:06 +0200 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2013-08-22 15:09:15 +0200 |
commit | 98b6fa4676a1ff847eb3968c885a4feac22b8086 (patch) | |
tree | 180d92c5ea15304c28a479936c9276ba82421bcf /campusconnect | |
parent | 1b5cda92e52418a6c8c60b76daa6b5106ab7002f (diff) | |
download | ecs2-98b6fa4676a1ff847eb3968c885a4feac22b8086.tar.gz ecs2-98b6fa4676a1ff847eb3968c885a4feac22b8086.zip |
participant.sh now handles events.
List all events:
participant.sh get /sys/events
Get oldest event (fifo):
participant.sh get /sys/events/fifo
Get and delete oldest event (fifo):
participant.sh delete /sys/events/fifo
FAQ:
Q: You want to delete all events.
A: Just call "participant.sh delete /sys/events/fifo" in a loop:
for i in `seq 10`; do ./participant.sh delete '/sys/events/fifo' ; done
This will get and delete always the oldest event. If there no more events
you will get back nothing. Just repeat the loop until you don't get anything
back.
Diffstat (limited to 'campusconnect')
-rwxr-xr-x | campusconnect/scripts/participant.sh | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/campusconnect/scripts/participant.sh b/campusconnect/scripts/participant.sh index aa1cdd8..297e687 100755 --- a/campusconnect/scripts/participant.sh +++ b/campusconnect/scripts/participant.sh @@ -37,7 +37,7 @@ SENDER=$FALSE RECEIVER=$FALSE ALL=$FALSE CURL_OPTIONS="-s" -REDIRECT_IO=" 2>/dev/null" +REDIRECT_IO="" ### ### Usage @@ -78,6 +78,22 @@ Examples: Delete courselinks where I'm a receiver or sender of: participant.sh -a delete /campusconnect/courselinks + List all events: + participant.sh get /sys/events + + Get oldest event (fifo): + participant.sh get /sys/events/fifo + + Get and delete oldest event (fifo): + participant.sh delete /sys/events/fifo + +FAQ: + Q: You want to delete all events. + A: Just call "participant.sh delete /sys/events/fifo" in a loop: + for i in `seq 10`; do ./participant.sh delete '/sys/events/fifo' ; done + This will get and delete always the oldest event. If there no more events + you will get back nothing. Just repeat the loop until you don't get anything + back. EOF } @@ -117,6 +133,10 @@ if [ "x`echo $rid | grep '^[0-9]\+$'`" != "x" -a "x$namespace" != "x" -a "x$reso cmd="curl $CURL_OPTIONS --cacert $CACERT --cert $CERT --key $KEY --pass $PASS \ -X DELETE ${ECS_URL}$1 $REDIRECT_IO" eval $cmd +elif [ "x$rid" = "xfifo" -a "x$namespace" = "xsys" ]; then + cmd="curl $CURL_OPTIONS --cacert $CACERT --cert $CERT --key $KEY --pass $PASS \ + -X POST ${ECS_URL}$1 $REDIRECT_IO" + eval $cmd elif [ "x`echo $rid | grep '^[0-9]\+$'`" = "x" -a "x$namespace" != "x" -a "x$resourcename" != "x" ]; then curl_options="$CURL_OPTIONS" CURL_OPTIONS= |