Hello,
I am attempting to connect our VPN connection automatically if an active internet connection exists. Everything was working fine until 10.5. The current script looks like this:
try
do shell script “curl ‘www.google.com’”
set theinternet to true
on error
set theinternet to false
end try
if the internet is false then
quit
end if
if theinternet is true then
tell application “Internet Connect.app”
set PPTPc to get name of «class cnft» 1
set vpnState to «class RAsb» of «class RSst» of «class cnfg» PPTPc
set newConnection to false
if vpnState is 8 then
quit
else
«event netcconn» «class cnfg» PPTPc
delay 8
if «class RAsb» of «class RSst» of «class cnfg» PPTPc is 8 then
set newConnection to true
end if
end if
end tell
end if
Furethermore, this scipt will run on a cron tab every hour.
Any help would be greatly appreciated.
Thanks!