From da8a0d4f2337a3f2ac2c69ac7b646adad12de897 Mon Sep 17 00:00:00 2001 From: qo-op Date: Tue, 12 May 2020 01:33:29 +0200 Subject: [PATCH] sort -u --- g1sms/tools/duniter_getnode.sh | 2 +- zen/tools/duniter_getnode.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/g1sms/tools/duniter_getnode.sh b/g1sms/tools/duniter_getnode.sh index f499716..7591069 100755 --- a/g1sms/tools/duniter_getnode.sh +++ b/g1sms/tools/duniter_getnode.sh @@ -69,7 +69,7 @@ find $DIR/ -cmin +20 -type f -name "duniter_*" -exec rm -f '{}' \; if [[ ! -f $DIR/duniter_nodes.txt ]]; then # Get New BMAS known Nodes list from shuffle one $DIR/good.nodes.txt [[ -f $DIR/good.nodes.txt ]] && DUNITER=$(shuf -n 1 $DIR/good.nodes.txt) || DUNITER="duniter-g1.p2p.legal:443" - curl -s https://$DUNITER/network/peers | jq '.peers[] | .endpoints' | grep BMAS | awk '{print $2,$3}' | sed s/\"//g | sed s/\,//g | sed s/\ /:/g > $DIR/duniter_nodes.txt + curl -s https://$DUNITER/network/peers | jq '.peers[] | .endpoints' | grep BMAS | awk '{print $2,$3}' | sed s/\"//g | sed s/\,//g | sed s/\ /:/g | sort -u > $DIR/duniter_nodes.txt fi # Grab the nodes we are actively watching - they will be in bold in the final output diff --git a/zen/tools/duniter_getnode.sh b/zen/tools/duniter_getnode.sh index f499716..7591069 100755 --- a/zen/tools/duniter_getnode.sh +++ b/zen/tools/duniter_getnode.sh @@ -69,7 +69,7 @@ find $DIR/ -cmin +20 -type f -name "duniter_*" -exec rm -f '{}' \; if [[ ! -f $DIR/duniter_nodes.txt ]]; then # Get New BMAS known Nodes list from shuffle one $DIR/good.nodes.txt [[ -f $DIR/good.nodes.txt ]] && DUNITER=$(shuf -n 1 $DIR/good.nodes.txt) || DUNITER="duniter-g1.p2p.legal:443" - curl -s https://$DUNITER/network/peers | jq '.peers[] | .endpoints' | grep BMAS | awk '{print $2,$3}' | sed s/\"//g | sed s/\,//g | sed s/\ /:/g > $DIR/duniter_nodes.txt + curl -s https://$DUNITER/network/peers | jq '.peers[] | .endpoints' | grep BMAS | awk '{print $2,$3}' | sed s/\"//g | sed s/\,//g | sed s/\ /:/g | sort -u > $DIR/duniter_nodes.txt fi # Grab the nodes we are actively watching - they will be in bold in the final output