Skip to content

does not work if resolv.conf uses tabs instead of spaces #85

@telnetdoogie

Description

@telnetdoogie

Running this script on synology out-of-the-box incorrectly gathers invalid nameservers for the host.

cat /etc/resolv.conf | grep ^nameserver | cut -d " " -f 2 | sed 's/\(.*\)/&#&/'
nameserver	192.168.1.1#nameserver	192.168.1.1

...this is resolved by adding cut -f 2 (which uses the default tab delimiter for cut) and it also continues to work on other OSes where the space is used. I'll create a PR for this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions