Skip to content

Commit

Permalink
fail if entry present
Browse files Browse the repository at this point in the history
  • Loading branch information
palashvij-msft committed Aug 24, 2023
1 parent 59f8df5 commit 540fb9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mountscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,14 @@ if ! is_valid_blob_fqdn "$nfs_host"; then
exit 1
fi

# fail if the desired entry is present in /etc/hosts
if grep -q "$nfs_host" /etc/hosts; then
eecho "Detected static resolution entry for "$nfs_host" in /etc/hosts."
eecho "[Action Required]: To avoid conflicts and to ensure correctly handling endpoint IP address changes by AZNFS,
remove the entry for "$nfs_host" in /etc/hosts."
exit 1
fi

nfs_ip=$(resolve_ipv4 "$nfs_host")
if [ $? -ne 0 ]; then
echo "$nfs_ip"
Expand Down

0 comments on commit 540fb9f

Please sign in to comment.