Re: How to Renew DHCP Lease
Re: How to Renew DHCP Lease
- Subject: Re: How to Renew DHCP Lease
- From: Sander Tekelenburg <email@hidden>
- Date: Mon, 18 Apr 2005 20:36:36 +0200
At 10:38 -0700 UTC, on 2005/04/18, Eric Geoffroy wrote:
> Or from 'do shell script as administrator...
>
> sudo ifconfig en1 down ; sudo ifconfig en1 up
Assuming en1 is the interface you wish to target, of course. The script below
let's you choose from the available interfaces (and remembers the last
choice).
property choice : ""
set interfaces to every word of (do shell script "ifconfig -l")
set choice to (choose from list interfaces with prompt "pick a network
interface" default items choice)
if choice is not false then
set choice to item 1 of choice as text
do shell script "ifconfig " & choice & " down ; ifconfig " & choice & "
up" with administrator privileges
end if
Now how about an easy way to recognise which interface is which? en0 seems to
refer to the Ethernetcard (in machines that have only one). But on my
PowerBook ifconfig -l gets me lo0, gif0, stf0, en0, en1 and fw0.
I assume Airport and BlueTooth are in that list somewhere, but which is
which, and what are the others?
--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden