Skip to content

Instantly share code, notes, and snippets.

@psyke83
Last active January 14, 2017 00:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save psyke83/a2476609557f58ad946d to your computer and use it in GitHub Desktop.
Save psyke83/a2476609557f58ad946d to your computer and use it in GitHub Desktop.
openwrt wl-842n ag71xx workaround
#!/bin/sh
trigger="eth1: tx timeout"
if [ "$1" = "force" ]; then
lastbuffer=""
else
lastbuffer=$(dmesg | grep "$trigger" | tail -n1)
fi
while true; do
buffer=$(dmesg | grep "$trigger" | tail -n1)
if [ "$buffer" != "$lastbuffer" ]; then
lastbuffer=$buffer
/etc/init.d/network restart
fi
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment