Skip to content

Commit

Permalink
use jq -r
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Sep 6, 2024
1 parent cc003c8 commit 5743442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/nm-quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,10 @@ setup_mesh() {
fi

echo "Obtaining a netmaker enrollment key..."
local netmakerTag=$(nmctl enrollment_key list | jq '.[] | .tags[0]' | tr -d '"')
local netmakerTag=$(nmctl enrollment_key list | jq -r '.[] | .tags[0]')
if [ ${netmakerTag} = "netmaker" ]; then
# key exists already, fetch token
TOKEN=$(nmctl enrollment_key list | jq '.[] | select(.tags[0]=="netmaker") | .token' | tr -d '"')
TOKEN=$(nmctl enrollment_key list | jq -r '.[] | select(.tags[0]=="netmaker") | .token')
else
local tokenJson=$(nmctl enrollment_key create --tags netmaker --unlimited --networks netmaker)
TOKEN=$(jq -r '.token' <<<${tokenJson})
Expand Down

0 comments on commit 5743442

Please sign in to comment.