Kill all internet connections with one button on Mac I'm looking for something that I can use to kill all internet connections on my mac. Something that turns the wifi off, turns off the ethernet connections. Maybe an apple script or something. I tried using automator and using the Watch me Do, turning off the wifi and then making some changes to it's apple scipt, but that only works sometimes. I need something that will work every time, and good. Here's what I had in apple script, maybe someone smart can have a look and maybe remove the delay time altogether (I tried that, wouldnt' &quot;compile&quot;)
on run {input, parameters}
-- Click the “Apple” menu.
delay 0.01
set timeoutSeconds to 0.0
set uiScript to &quot;click menu bar item \&quot;Apple\&quot; of menu bar 1 of application process \&quot;Finder\&quot;&quot;
my doWithTimeout(uiScript, timeoutSeconds)

-- System Preferences…
delay 0.01
set timeoutSeconds to 0.01
set uiScript to &quot;click menu item 4 of menu 1 of menu bar item \&quot;Apple\&quot; of menu bar 1 of application process \&quot;Finder\&quot;&quot;
my doWithTimeout(uiScript, timeoutSeconds)

-- Click the “Network” button.
delay 0.01
set timeoutSeconds to 0.01
set uiScript to &quot;click UI Element \&quot;Network\&quot; of scroll area 1 of window \&quot;System Preferences\&quot; of application process \&quot;System Preferences\&quot;&quot;
my doWithTimeout(uiScript, timeoutSeconds)

-- Click the “Turn Wi-Fi Off” button.
delay 0.01
set timeoutSeconds to 0.01
set uiScript to &quot;click UI Element \&quot;Turn Wi-Fi Off\&quot; of group 1 of window \&quot;Network\&quot; of application process \&quot;System Preferences\&quot;&quot;
my doWithTimeout(uiScript, timeoutSeconds)
return input

end run

on doWithTimeout(uiScript, timeoutSeconds)
    set endDate to (current date) + timeoutSeconds
    repeat
        try
            run script &quot;tell application \&quot;System Events\&quot;
&quot; &amp; uiScript &amp; &quot;
end tell&quot;
            exit repeat
        on error errorMessage
            if ((current date) &gt; endDate) then
                error &quot;Can not &quot; &amp; uiScript
            end if
        end try
    end repeat
end doWithTimeout

Thanks for your help!
Launch System Preferences

Go to &quot;Network&quot; pane and click on &quot;Location&quot; dropdown:




Choose &quot;Edit Locations…&quot; from the dropdown, and then the + in the small window which appears. This will create an &quot;Untitled&quot; location. I recommend renaming it to &quot;Offline&quot; or something similar. Click &quot;Done&quot;



With the &quot;Offline&quot; location now active, select each connection/service in the left column (WiFi, Ethernet, etc). Then click the circle icon at the bottom of the left column and choose &quot;Make Service Inactive&quot; as shown below:



After you have repeated that for each action, click &quot;Apply&quot; at the bottom-right of the window.

Once that is done, you can &quot;kill&quot; all of your network connections by switching to the &quot;Offline&quot; location, and re-enable them by switching back the &quot;Automatic&quot; location (or equivalent).
You can switch to that location by any number of methods. My preferred way would be to use a Keyboard Maestro macro, as Keyboard Maestro has a built-in feature to switch locations, and you can easily bind such a macro to a keyboard shortcut.
You could also do it with a shell script which ran
/usr/sbin/networksetup -switchtolocation 'Offline'
(Replace Offline with whatever you named your location.)
Note that many of /usr/sbin/networksetup's features require sudo but -switchtolocation does not.
To get back online, you would need to run /usr/sbin/networksetup -switchtolocation 'Automatic'
Or whatever your default location is called.
You can also quickly switch locations via &quot;the  menu&quot; which will add a &quot;Locations&quot; sub-menu once there is more than one location defined.