Skip to content

Instantly share code, notes, and snippets.

@andreacioni
Created December 10, 2017 12:53
Show Gist options
  • Save andreacioni/0602c527c6fce5ff8c60c75697dd6245 to your computer and use it in GitHub Desktop.
Save andreacioni/0602c527c6fce5ff8c60c75697dd6245 to your computer and use it in GitHub Desktop.
Restart 8169 module on startup
from subprocess import call
from time import sleep
while call(["/bin/ping","-c","1","8.8.8.8"]) == 0:
print "Network is not reachable, try restarting r8169 driver"
call(["rmmod","r8169"])
sleep(5)
call(["modprobe","r8169"])
sleep(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment