Skip to content
This repository was archived by the owner on Jul 22, 2022. It is now read-only.
This repository was archived by the owner on Jul 22, 2022. It is now read-only.

Peer nodes are not discovered if hostname includes "-" character #46

@avkonst

Description

@avkonst

fixed version of get_nodes:

get_nodes() {
    if [ -z "${node_peers}" ]
    then
        node_ids_and_names=$(weave status peers | sed 's/^.*[:][0]\?[0]\?//')
        for node_id_and_name in $node_ids_and_names
        do
            node_peer_id=$(echo ${node_id_and_name} | sed 's/([^\)]*)//g')
            node_peer_name=$(echo ${node_id_and_name} | sed 's/\([0-9]*(\)//g' | sed 's/[)]//g')
            node_peers="${node_peer_id} ${node_peers}"
            node_names[$node_peer_id]=$node_peer_name
        done
        failed_connections_count=$(weave status connections | grep -v established | grep -v "connect to ourself" | wc -l)
        if [ ${failed_connections_count} -ne 0 ] && [ -z "${1:-}" ]
        then
            return 1
        fi
    fi
    return 0
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions