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

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

Open
avkonst opened this issue Aug 21, 2020 · 0 comments
Open

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

avkonst opened this issue Aug 21, 2020 · 0 comments

Comments

@avkonst
Copy link
Collaborator

avkonst commented Aug 21, 2020

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
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant