Created
October 3, 2018 13:04
-
-
Save ssoriche/92a0315ccc453702c2f8190756e3d3c6 to your computer and use it in GitHub Desktop.
When running macOS firewall and wireguard installed from home-brew, the following script will open the firewall. Run after installation and every upgrade of `wireguard-tools` as the path to `wg-quick` will change.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
fix_wireguard() { | |
local fw='/usr/libexec/ApplicationFirewall/socketfilterfw' | |
local wg_sym="$(which wg-quick)" | |
local wg_abs="$(greadlink -f $wg_sym)" | |
sudo "$fw" --setglobalstate off | |
sudo "$fw" --add "$wg_sym" | |
sudo "$fw" --unblockapp "$wg_sym" | |
sudo "$fw" --add "$wg_abs" | |
sudo "$fw" --unblockapp "$wg_abs" | |
sudo "$fw" --setglobalstate on | |
} | |
fix_wireguard; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment