This is a super simple bash script that will ping Googles DNS servers every 10 minutes and if there is no response, try an interface down/up before it rebooting the machine.
NOTE:
You will probably need to update the script where it says igc0 with your WAN interfaces name (you can find this easily through the GUI or by running ifconfig).
- Copy the ping_check.sh file to /usr/local/etc/rc.d
- Make it executable with chmod 755 ping_check.sh
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Install build dependencies + appropriate linux-headers package | |
| apt install -y dkms build-essential pve-headers-$(uname -r) | |
| # Download the latest r8125 dkms package | |
| curl -s https://api.github.com/repos/awesometic/realtek-r8125-dkms/releases/latest | | |
| grep "browser_download_url.*amd64.deb" | | |
| cut -d : -f 2,3 | | |
| tr -d \" | | |
| wget -i - |