Skip to content

Instantly share code, notes, and snippets.

@jonathanhle
Last active July 9, 2025 00:05
Show Gist options
  • Select an option

  • Save jonathanhle/bec06c9d74f2909ba91b0f4891db7ce2 to your computer and use it in GitHub Desktop.

Select an option

Save jonathanhle/bec06c9d74f2909ba91b0f4891db7ce2 to your computer and use it in GitHub Desktop.
Reset Twingate OSX Client
#!/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