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

avoid duplicate nameserver entries in resolv.conf #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thechile
Copy link

currently the deemed best nameserver denoted by "use_server" will occur twice in the resolv.conf output which isn't ideal and in some circumstances could incur delayed lookups if it were to fail before the next cronjob to test for availability.

Proposed change ensures each nameserver exists only once.

currently the deemed best nameserver denoted by "use_server" will occur twice in the resolv.conf output which isn't ideal and in some circumstances could incur delayed lookups if it were to fail before the next cronjob to test for availability. 

Proposed change ensures each nameserver exists only once.
@kvz
Copy link
Owner

kvz commented Oct 15, 2013

Thanks for the patch but resolvconf+="nameserver $ns\n" doesn't look like bash?

@thechile
Copy link
Author

http://www.tldp.org/LDP/abs/html/ops.html gives example of the += as a numeric variable operator with a footnote http://www.tldp.org/LDP/abs/html/ops.html#FTN.AEN3900 saying it can also be used as string concatenation.. as used in the patch.

@kvz
Copy link
Owner

kvz commented Oct 15, 2013

Looks like it. But only as of bash 3.1. For the sake for portability I think I'd prefer full="first${surname}". Also would like the code style to match. It also is a little bit more complex, risking bugs. I'll think about it some more and maybe rewrite it to address my concerns. I'll do it on top of your work so you'll still be credited then though

@thechile
Copy link
Author

ok, sounds good. Look forward to using the script soon. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants