Skip to content

Commit

Permalink
Merge pull request #327 from beckn/develop
Browse files Browse the repository at this point in the history
Fix exact domain matching logic in shell script
  • Loading branch information
prasad-takale-eminds authored Dec 17, 2024
2 parents 166d129 + 7fe35ad commit 32c2718
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions install/beckn-onix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ install_registry() {
echo "Registry installation successful"

#Update Role Permission for registry.
bash scripts/registry_role_permissions.sh
if [[ $1 ]]; then
bash scripts/registry_role_permissions.sh $1
else
bash scripts/registry_role_permissions.sh
fi
}

# Function to install Layer2 Config
Expand Down Expand Up @@ -355,7 +359,7 @@ get_np_domain() {
local login_url="${registry_url%/subscribers}"
read -p "Enter the domain name for $1 : " np_domain
domain_present=$(curl -s -H "ApiKey:$api_key" --header 'Content-Type: application/json' $login_url/network_domains/index | jq -r '.[].name' | tr '\n' ' ')
if echo "$domain_present" | grep -qw "$np_domain"; then
if echo ":$domain_present:" | grep -qw ":$np_domain:"; then
return 0
else
echo "${BoldRed}The domain '$np_domain' is NOT present in the network domains.${NC}"
Expand Down

0 comments on commit 32c2718

Please sign in to comment.