aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/wg-quick/darwin.bash
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 02:17:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 04:05:04 +0200
commit9c18c70da65fe0de72719f32518d515b3843d303 (patch)
treee96c9acbb3a4366318a7cc91a991a6a91febe287 /src/wg-quick/darwin.bash
parentwg-quick: darwin: remove v6 routes after shutdown (diff)
downloadwireguard-tools-9c18c70da65fe0de72719f32518d515b3843d303.tar.xz
wireguard-tools-9c18c70da65fe0de72719f32518d515b3843d303.zip
wg-quick: darwin: bash correctness
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/wg-quick/darwin.bash')
-rwxr-xr-xsrc/wg-quick/darwin.bash9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash
index ca7e901..5c25961 100755
--- a/src/wg-quick/darwin.bash
+++ b/src/wg-quick/darwin.bash
@@ -204,12 +204,12 @@ set_endpoint_direct_route() {
if [[ $remove_all_old -eq 1 ]]; then
for endpoint in "${ENDPOINTS[@]}"; do
- [[ " ${old_endpoints[*]} " == *"$endpoint"* ]] || old_endpoints+=( "$endpoint" )
+ [[ " ${old_endpoints[*]} " == *" $endpoint "* ]] || old_endpoints+=( "$endpoint" )
done
fi
for endpoint in "${old_endpoints[@]}"; do
- [[ $remove_all_old -eq 0 && " ${ENDPOINTS[*]} " == *"$endpoint"* ]] && continue
+ [[ $remove_all_old -eq 0 && " ${ENDPOINTS[*]} " == *" $endpoint "* ]] && continue
if [[ $endpoint == *:* ]]; then
cmd route -q delete -inet6 "$endpoint" >/dev/null 2>&1 || true
else
@@ -218,7 +218,7 @@ set_endpoint_direct_route() {
done
for endpoint in "${ENDPOINTS[@]}"; do
- if [[ $remove_all_old -eq 0 && " ${old_endpoints[*]} " == *"$endpoint"* ]]; then
+ if [[ $remove_all_old -eq 0 && " ${old_endpoints[*]} " == *" $endpoint "* ]]; then
added+=( "$endpoint" )
continue
fi
@@ -240,9 +240,7 @@ set_dns() {
# want DNS via DHCP when setting this back to "empty". Because macOS is
# so horrible to deal with here, we'll simply wait for irate users to
# provide a patch themselves.
-
local service response
-
{ read -r _; while read -r service; do
[[ $service == "*"* ]] && service="${service:1}"
while read -r response; do
@@ -252,6 +250,7 @@ set_dns() {
}
del_dns() {
+ local service response
{ read -r _; while read -r service; do
[[ $service == "*"* ]] && service="${service:1}"
while read -r response; do