mirror of
https://github.com/ivanilves/xiringuito.git
synced 2025-06-01 15:00:20 -07:00
Merge branch 'mac-dns'
* mac-dns: Set Mac DNS. ALWAYS Fix network service detection for MacOSX
This commit is contained in:
commit
6943a690d2
@ -2,14 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Update MacOSX DNS
|
# Update MacOSX DNS
|
||||||
#
|
#
|
||||||
if [[ ${#} != 1 ]]; then
|
NETWORK_SERVICE="$($(dirname ${0})/get-network-service-name.sh)"
|
||||||
echo "Usage: ${0} LOCAL_TUNNEL_ID"
|
DNS_SERVERS=$(grep nameserver /etc/resolv.conf | awk '{print $2}' | tr '\n' ' ')
|
||||||
exit 1
|
echo "* Setting DNS for \"${NETWORK_SERVICE}\": ${DNS_SERVERS}"
|
||||||
fi
|
sudo networksetup -setdnsservers "${NETWORK_SERVICE}" ${DNS_SERVERS}
|
||||||
|
|
||||||
if [[ -f /tmp/xiringuito.dns.${1} ]]; then
|
|
||||||
NETWORK_SERVICE="$($(dirname ${0})/get-network-service-name.sh)"
|
|
||||||
DNS_SERVERS=$(grep nameserver /etc/resolv.conf | awk '{print $2}' | tr '\n' ' ')
|
|
||||||
echo "* Setting DNS for \"${NETWORK_SERVICE}\": ${DNS_SERVERS}"
|
|
||||||
sudo networksetup -setdnsservers "${NETWORK_SERVICE}" ${DNS_SERVERS}
|
|
||||||
fi
|
|
||||||
|
@ -2,4 +2,10 @@
|
|||||||
#
|
#
|
||||||
# Get name of the MacOSX network service (device connection)
|
# Get name of the MacOSX network service (device connection)
|
||||||
#
|
#
|
||||||
networksetup -listnetworkserviceorder | grep '^(1) ' | sed 's/^(1) //'
|
if [[ -n "${FORCE_NETWORK_SERVICE}" ]]; then
|
||||||
|
echo "${FORCE_NETWORK_SERVICE}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEF_GW_IF=$(netstat -nr | grep default | tail -n1 | awk '{print $NF}')
|
||||||
|
networksetup -listnetworkserviceorder | grep -B1 " Device: ${DEF_GW_IF})" | head -n1 | sed 's/^(.*) //'
|
||||||
|
@ -114,7 +114,7 @@ if [[ ! ${NO_DNS} && ! -z "${NETWORKS}" ]]; then
|
|||||||
echo "${REMOTE_RESOLV_CONF}" | ./scripts/client-update-resolv-conf.sh
|
echo "${REMOTE_RESOLV_CONF}" | ./scripts/client-update-resolv-conf.sh
|
||||||
|
|
||||||
if [[ ${KERNEL} == darwin ]]; then
|
if [[ ${KERNEL} == darwin ]]; then
|
||||||
./scripts/${KERNEL}/client-update-macosx-dns.sh ${LOCAL_TUNNEL_ID}
|
./scripts/${KERNEL}/client-update-macosx-dns.sh
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user