actually, I thought that running this every minute maybe is to long a time, since I don't want to wait a whole minute for a page to open, so you can write it like this:
#!/bin/sh while true; do ping -v -c 1 -w 1 192.168.1.1 | grep -q "100.0% packet loss" if [ ${?} -eq 0 ] then ifconfig iwn0 down && ifconfig iwn0 up fi sleep 3 done & This way it will run in the background every three seconds. Suggestions welcomed from people that know more than I do to solve this issue in another way. ---------- Forwarded message ---------- I've made up this script that seems to work. Be warned: I am NOT a developer, so use with care at your own risk. But it seems to work just fine, really... ping -v -c 1 -w 1 192.168.1.1 | grep -q "100.0% packet loss" if [ ${?} -eq 0 ] then ifconfig iwn0 down && ifconfig iwn0 up fi You can put it in a cronjob as root and you are done. Now I have a question: does it make any harm to the nic to bring it up and down all the time? I loose the connection really often On Fri, 31 Jul 2009, Mustafa Seckin wrote: > Can you share the mentioned script with me?B Thanks... > > > Date: Sat, 1 Aug 2009 07:30:47 +0800 > > From: shweg...@gmail.com > > To: ted.unan...@gmail.com > > CC: misc@openbsd.org > > Subject: Re: Thinkpad x200 wireless hang (5.1 firmware) > > > > I've tried that, and it seems to do the trick. > > How would a script look like that does: > > ifconfig iwn0 down && ifconfig iwn0 up > > every time it sees it hanging, maybe checking with ping or so? > > > > tks > > > > > > On Thu, 30 Jul 2009, Ted Unangst wrote: > > > > > On Thu, Jul 30, 2009 at 8:40 AM, Stefan Wollny<ste...@wollny.de> wrote: > > >> With OpenBSD 4.4 wpi0 and run0 worked flawless - with 4.5 wireless is a > PITA! > > >> Connectivity drops sometimes after half an hour, sometimes after > seconds... > > >> :-( Restarting the system doesn't really help (after all: it's not > Windows > so > > >> this is sth. I expected...) > > > > > > ifconfig down and up brings it back right away.