1

I need to control dhcp address renew actions on Linux in my application written in C. I am trying to find the best way to retrieve this information from the system. So far I have actually come up with only one way - parsing the system logs and looking for address renewal information. However, this way is very inefficient. I can try to improve this by redirecting the logs from dhclient to a separate file and check only this one file. But it still seems to be a poor solution. Do you have any idea how to retrieve this information in a better way in C or bash? Thank you very much for any hints.

userr019283
  • 45
  • 1
  • 9
  • 1
    Trigger an action when dhcp logs. See https://unix.stackexchange.com/q/87223/64699 – stark Jul 09 '21 at 14:28
  • 2
    Here's something it seems: https://stackoverflow.com/questions/579783/how-to-detect-ip-address-change-programmatically-in-linux/2353441#2353441 – LMC Jul 09 '21 at 20:12

0 Answers0