Skip to content

Commit 32c2718

Browse files
Merge pull request #327 from beckn/develop
Fix exact domain matching logic in shell script
2 parents 166d129 + 7fe35ad commit 32c2718

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

install/beckn-onix.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ install_registry() {
103103
echo "Registry installation successful"
104104

105105
#Update Role Permission for registry.
106-
bash scripts/registry_role_permissions.sh
106+
if [[ $1 ]]; then
107+
bash scripts/registry_role_permissions.sh $1
108+
else
109+
bash scripts/registry_role_permissions.sh
110+
fi
107111
}
108112

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

0 commit comments

Comments
 (0)