MacOSX - Is Proccess Running
MacOSX - Is Proccess Running
- Subject: MacOSX - Is Proccess Running
- From: Brad Giesbrecht <email@hidden>
- Date: Tue, 09 Oct 2001 02:23:02 -0700
Hello,
I have a script that uses Internet Connect and Terminal.
How can I find out if Internet Connect and or Terminal are running
before I call?
I have counted the windows of Terminal and have come up with a
way to tell if there are any other Shells open but I don't trust this
method, plus someone could have Terminal running with no open
shells and I wouldn't want to quit it for them.
Here's some of what I'm doing:
----------------------------------------------------------------------------
set pSudo to " echo <my admin pass> | sudo -S "
tell application "Terminal"
do script with command <option return>
pSudo & "natd -interface ppp0 -dynamic yes ; " & <option return>
pSudo & "/sbin/ipfw -f flush ; " & <option return>
pSudo & "/sbin/ipfw add divert natd all from any to any via ppp0 ; "
& <option return>
pSudo & "/sbin/ipfw add allow ip from any to any ; " & <option
return>
"exit "
set sCount to (count of every window) - 8
if sCount = 1 then
quit
else
close window 1
end if
end tell
----------------------------------------------------------------------------
Also, do any FreeBSDer's know how I can make a ppp connection
passing the phone number, user, and password. I would rather
not use Internet Connect.
I havn't found what OSX is using to do ppp. Is it PPPd?
Thanks,
Bradley Giesbrecht