2 ENTITY=`cat .entity 2>/dev/null`
3 # If missing following, 1 is assigned (ENTITY_SS_1 is ENTITY_SS - 1)
4 ENTITY_SS=`cat .entityServerSessions 2>/dev/null`
5 [[ "$ENTITY_SS" = "" ]] && ENTITY_SS=1
11 echo "Use: $0 <hide|show|hidden|shown> \"[<address>:<port>]|[socket id]\""
13 echo "Hides/shows/query hidden state/query shown state, the socket/s provided."
14 echo "If missing server (first parameter) all applications sockets will be affected by action."
15 echo "If missing socket (second parameter) for specific server, all its sockets will be affected by action."
22 echo "Select option to switch (0 = quit):"
25 for i in `echo $ENTITY | sed 's/,/ /g'`
27 for j in `seq 0 $ENTITY_SS_1`
30 RES=$(./operation.sh "shown|$TARGET" | tail -1 | grep "true$")
32 [[ "$RES" != "" ]] && res=shown
33 echo "${option}. $TARGET ($res)"
35 [[ "$RES" != "" ]] && action=hide
36 echo "./operation \"$action|$TARGET\"" > .switch_${option}
37 chmod a+x .switch_${option}
44 if test "$ENTITY" != ""
46 ENTITY_SS_1=$((ENTITY_SS-1))
51 [[ "$option" = "0" ]] && break
59 [[ "$1" = "" ]] && use
64 operation="$1|$TARGET"
65 [[ "$TARGET" = "" ]] && operation="$1"
66 ./operation.sh "$operation"