Last active
July 9, 2025 00:05
-
-
Save jonathanhle/bec06c9d74f2909ba91b0f4891db7ce2 to your computer and use it in GitHub Desktop.
Reset Twingate OSX Client
This file contains hidden or 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 | |
| set -euo pipefail | |
| # Run this script directly via: | |
| # curl -sSL https://gist.githubusercontent.com/jonathanhle/bec06c9d74f2909ba91b0f4891db7ce2/raw/reset_twingate_osx.sh | bash | |
| # Some commands needs sudo | |
| # Prompt once for sudo (Touch ID enabled if pam_tid.so is configured) | |
| echo "π Unloading Twingate launch agent..." | |
| launchctl unload /Library/LaunchAgents/com.twingate.macos.plist | |
| echo "π Killing Twingate process..." | |
| killall Twingate 2>/dev/null || echo "β οΈ Twingate process not running" | |
| echo "π§Ή Removing Twingate support files..." | |
| rm -rf ~/Library/Application\ Support/Twingate | |
| rm -rf ~/Library/Caches/com.twingate.Twingate | |
| rm -rf ~/Library/Logs/Twingate | |
| echo "β Cleaned up Twingate user data" | |
| echo "π§Ό Flushing macOS DNS cache..." | |
| sudo dscacheutil -flushcache | |
| sudo killall -HUP mDNSResponder | |
| echo "β DNS cache flushed" | |
| echo "π Reloading Twingate launch agent..." | |
| launchctl load -w /Library/LaunchAgents/com.twingate.macos.plist | |
| echo "π Twingate agent reloaded" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment