Automated script to renew IP config on network issues

I had been facing an issue recently in my system that the network connection often got lost and the network icon would start showing the yellow icon indicating that no internet connection is available even though the system is connected to the network.

To solve this I had to run the command


I had to do this every time and many times would realize that the system had been offline for a while.

Started becoming a bummer to me when others needed to access to my system.

I implemented this script and fired it on startup. It performs a simple task

  • Check if is reachable
  • If Not then run IPCONFIG command
  • if the state is not changed even after this command. that means that your system is actually down. therefore stop retrying

Here is the script:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.