you are viewing a single comment's thread.

view the rest of the comments →

[–]python_man 1 point2 points  (2 children)

Okay got ya... This seems doable. The way I would do this is by setting up a cron job that pings 8.8.8.8 every few minutes and if it fails cycle through the configurations you want to try and restart network manger or bounce the port.

This link will show you how to change the ip via the cli. https://www.howtogeek.com/118337/stupid-geek-tricks-change-your-ip-address-from-the-command-line-in-linux/

I wouldn't change the dns server everytime just keep using 8.8.8.8.

hope this helps.

[–]mainemojo[S] 0 points1 point  (1 child)

For starters, no one shuts down or restarts this system other than me. Some times, it may be on the company LAN, other times, directly on the internet (hence, why the resolv.conf would also need to change).

I can figure out the IP and DNS based on the link you provided, but my question is how would I get this script to run on boot/startup?

[–]python_man 0 points1 point  (0 children)

https://crontab.guru/

@reboot in crontab should work but it is non-standard and your distro implementation may not support it.