refactor: make connection check be compatible with both python 2 and 3

This commit is contained in:
nugaon 2021-05-06 10:16:30 +02:00
parent 9a34ba2ff9
commit 0ecd8974ce

View File

@ -57,7 +57,7 @@ log_queen() {
}
count_connected_peers() {
COUNT=$( curl -s http://localhost:1635/peers | python -c 'import json,sys; obj=json.load(sys.stdin); print len(obj["peers"]);' )
COUNT=$( curl -s http://localhost:1635/peers | python -c 'import json,sys; obj=json.load(sys.stdin); print (len(obj["peers"]));' )
echo "$COUNT"
}