-
All replies
-
Helpful answers
-
May 1, 2016 4:19 AM in response to Thongjyby Joachim62,I am having this issue with a late 2014 27" Retina iMac running on El Capitan.
This is a work-around. If you had GROWL installed you could as well use GROWL rules to check for network related failure messages and do the same. But Scenario is easier to configure.
Get "Scenario" from the App Store and use this script as a wakeup script. Save the script as script, not as program.
So when you Mac wakes up, the script is triggered. It toggles between network "off" and your standard setting if your network is down. In my personal script I also mount lost network shares as well.
Fill in your credentials and make another network location with all network ports/services disabled (Call it "Off" or similar, no spaces in any of the location names!).
I hope it helps,
Cheers, Joachim
# Fill in your credentials and router address, change location names if necessary
set routeraddress to "0.0.0.0"
set username to "YOUR_NAME"
set userpassword to "YOUR_PASSWORD"
# Two network locations, one Network off, and your standard location (here "Ethernet")
set network_off to "Off"
set network_on to "Ethernet"
try
# Hello Router
delay 2
set ping_result to (do shell script "ping -c 1 " & routeraddress)
on error
# if network is not available, toggle network settings
do shell script "networksetup -switchtolocation " & network_off user name username password userpassword with administrator privileges
do shell script "networksetup -switchtolocation " & network_on user name username password userpassword with administrator privileges
end try