diff --git a/Services/fixInternetAfterSleep.sh b/Services/fixInternetAfterSleep.sh new file mode 100755 index 0000000..5a9de9b --- /dev/null +++ b/Services/fixInternetAfterSleep.sh @@ -0,0 +1,4 @@ +if ! ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then + modProbeNumber=$(sudo dmesg | grep -m1 "enp1s0: link down" | awk '{if ($2 ~ /r[0-9].*/) { col=$2 } else { col=$3 }; gsub(":", "", col); print col }') + sudo modprobe -r "$modProbeNumber" && sleep 10 && sudo modprobe "$modProbeNumber" +fi