Update set_fact.sh to support multiple network

Currently the role will fail to regather fact if $network_count > 1

That's because without the quotes echo will suppress the \n writing everything in one line. Thus wc -l will return `1`, confusing the file_content function that will lead to an incorrect json being produced
pull/31/head
Andrea Lora 2019-07-08 11:40:05 +01:00 committed by GitHub
parent c7aae63e16
commit 0755fa30b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ NETWORKS=$(zerotier-cli listnetworks | tail -n+2)
function file_content {
if [ ! -z "$NETWORKS" ]; then
network_count=$(echo $NETWORKS |wc -l)
network_count=$(echo "$NETWORKS" |wc -l)
counter=1
echo "{"