2

Dear Superuser Community,

I'm writing on a a script that renews the DHCP Lease. To function correctly on other computers, how can renew the DHCP Lease without knowing if en0 or en1 is active.

Is it ok to reset both: sudo ipconfig set en0 DHCP; sudo ipconfig set en1 DHCP?

Edit: The OS is OSX El Capitan (Sorry, I forgot the most important info)

Thanks in advance

2
  • 1
    What OS is this for?
    – Zoredache
    Commented Jul 18, 2016 at 20:59
  • It's for OSX El Capitan (Sorry I missed that)
    – Max
    Commented Jul 19, 2016 at 20:24

1 Answer 1

0

If I remember correctly, as long as both interfaces are defined in /etc/network/interfaces running the command on both should be fine.

EDIT: I assumed this was a Linux question based on the use of sudo. It may be useful to add this to your question since ipconfig is a Windows command.

2
  • It's for OSX El Capitan - thanks for the hint, I added this in my question
    – Max
    Commented Jul 19, 2016 at 20:25
  • I believe the info in my answer is still correct for OSX however Mac isn't my strong point so I'm not entirely sure. Commented Jul 19, 2016 at 20:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .