Commit 00ae6a2e authored by Tails developers's avatar Tails developers
Browse files

Simplify regex by using grep's --extended-regexp.

parent a3bf5959
......@@ -99,13 +99,13 @@ if [ -r "${NM_ENV_FILE}" ]; then
# contain any unexpected data, like (potentially malicious) shell
# script. Note that while the regex used for deciding IP addresses
# is far from perfect, it serves our purpose here.
if grep -qv "${NAMESERVERS_REGEX}" "${NM_ENV_FILE}"; then
if grep --extended-regexp -qv "${NAMESERVERS_REGEX}" "${NM_ENV_FILE}"; then
error "`gettext \"NetworkManager passed us garbage data when trying to deduce the clearnet DNS server.\"`"
# Import the IP4_NAMESERVERS variable.
eval "$(grep "${NAMESERVERS_REGEX}" "${NM_ENV_FILE}")"
eval "$(grep --extended-regexp "${NAMESERVERS_REGEX}" "${NM_ENV_FILE}")"
# ... otherwise fail.
# FIXME: Or would it make sense to fallback to Google's DNS or OpenDNS?
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment