hi, found 'solution?' on forum wifi loss in osx lion 10.7.2.
here tell me if can trusted?
in advance , cheers!
"keepalive.sh"
#!/bin/bash
ping -i 5 -n yahoo.com
------------
"main.scpt"
set scriptname "keepalive.sh" -- change script called
set mypath (path me) string
set mypath posix_path(mypath)
shell script "/bin/sh " & mypath & "contents/resources/scripts/" & scriptname & " &> /dev/null"
on posix_path(mac_path)
set mac_path (mac_path text)
set root (offset of ":" in mac_path)
set rootdisk (characters 1 thru (root - 1) of mac_path)
tell application "finder"
if (disk (rootdisk string) startup disk) then
set unixpath "/" & (characters (root + 1) thru end of mac_path)
else
set unixpath "/volumes:" & mac_path
end if
end tell
set chars every character of unixpath
repeat 2 length of chars
if item of chars text equal "/" then
set item of chars ":"
else if item of chars text equal ":" then
set item of chars "/"
else if item of chars text equal "'" then
set item of chars "\\'"
else if item of chars text equal "\"" then
set item of chars "\\" & "\""
else if item of chars text equal "*" then
set item of chars "\\*"
else if item of chars text equal "?" then
set item of chars "\\?"
else if item of chars text equal " " then
set item of chars "\\ "
else if item of chars text equal "\\" then
set item of chars "\\\\"
end if
end repeat
return every item of chars string
end posix_path
---------
all applescript main.scpt in starts keepalive.sh. of custom code translate path macintosh hd:users:me /users/me. don't why posix path built applescript wasn't used.
keepalive.sh start ping command ping yahoo.com indefinitely every 5 seconds.
guess objective not never let wireless link idle more 5 seconds.
afaik. main.scpt can simplified to:
code:set scriptname "keepalive.sh" -- change script called set mypath path me set mypath posix path of mypath shell script "/bin/sh " & mypath & "contents/resources/scripts/" & scriptname & " &> /dev/null"
Forums Macs Mac Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment