Commit 475579e1 authored by phil's avatar phil

fixes after review with master alain

parent b7608c7e
......@@ -26,19 +26,20 @@ if [ ! -f "$INDEX" ]; then
touch "$INDEX"
fi
echo "read index & register"
SUBSCRIBERS=$(cat "$INDEX" "$REGISTER")
rm "$REGISTER"
touch "$NEW_INDEX"
# publish message to channels in subscriber-index
for SUBSCRIBER in $SUBSCRIBERS; do
# regex check for match
if [[ "$SUBSCRIBER" =~ "$TARGET" ]]; then
SUBSCRIBER_PATH="$PUBSUB_BASE/$SUBSCRIBER"
if [ -p "$SUBSCRIBER_PATH" ]; then
SUBSCRIBER_PATH="$PUBSUB_BASE/$SUBSCRIBER"
if [ -p "$SUBSCRIBER_PATH" ]; then
echo "$SUBSCRIBER" >> "$NEW_INDEX"
if [[ "$SUBSCRIBER" =~ "$TARGET" ]]; then
echo "publish to $SUBSCRIBER_PATH"
echo "$MESSAGE" >> "$SUBSCRIBER_PATH"
echo "$SUBSCRIBER" >> "$NEW_INDEX"
fi
fi
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment