3 TRACE="--trace-ascii curl_log.txt"
4 SERVER=`cat .httpServer`
5 ENTITY=`cat .entity 2>/dev/null`
6 # If missing following, 1 is assigned (ENTITY_SS_1 is ENTITY_SS - 1)
7 ENTITY_SS=`cat .entityServerSessions 2>/dev/null`
8 [[ "$ENTITY_SS" = "" ]] && ENTITY_SS=1
14 echo "Use: $0 <hide|show|hidden|shown> \"[<address>:<port>]|[socket id]\""
16 echo "Hides/shows/query hidden state/query shown state, the socket/s provided."
17 echo "If missing server (first parameter) all applications sockets will be affected by action."
18 echo "If missing socket (second parameter) for specific server, all its sockets will be affected by action."
25 echo "Select option to switch (0 = quit):"
28 for i in `echo $ENTITY | sed 's/,/ /g'`
30 for j in `seq 0 $ENTITY_SS_1`
33 RES=$(curl -m 1 --data "shown|$TARGET" ${SERVER} 2>&1 | tail -1 | grep "true$")
35 [[ "$RES" != "" ]] && res=shown
36 echo "${option}. $TARGET ($res)"
38 [[ "$RES" != "" ]] && action=hide
39 echo "curl -m 1 --data \"$action|$TARGET\" ${SERVER}" > .switch_${option}
40 chmod a+x .switch_${option}
47 if test "$ENTITY" != ""
49 ENTITY_SS_1=$((ENTITY_SS-1))
54 [[ "$option" = "0" ]] && break
62 [[ "$1" = "" ]] && use
67 operation="$1|$TARGET"
68 [[ "$TARGET" = "" ]] && operation="$1"
69 curl -m 1 --data "$operation" $TRACE ${SERVER}