Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exact domain matching logic in shell script #327

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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