Run script on wifi/lan connection change on MacOS

Veröffentlicht von

TLDR; Upon network change, update dyndns ( by running a curl command

Since my servers access are additionally secured by allowing access only from a specific hostname, it is necessary to update my dynamic dns (I am using which is working flawless and is cheap too) whenever my network connection changes (and apparently if other system configuration settings are changed, which also might involve VPNs, Proxies or non-network related settings).

It might also be used to run an external script, but in my case it is sufficient to do a curl request to a specific URL from my laptop.

--BEGIN org.afraid.freedns.plist--
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
--END org.afraid.freedns.plist--

Save this as org.afraid.freedns.plist to Library/LaunchAgents/com.afraid.dyndns.updater.plist and you’re good to go.