Date: Mon, 20 Mar 2006 12:20:12 +0100 From: "Evil I_Am" <evil_ftw@hotmail.com> To: freebsd-questions@freebsd.org Subject: Re: Automatic interface down Message-ID: <BAY104-F33155FF968DFE803378911E3DB0@phx.gbl> In-Reply-To: <1142849183.4133.36.camel@siseci.gdg.gov.tr>
next in thread | previous in thread | raw e-mail | index | archive | help
I am trying it,but i still have problems. Here is my ifstated.conf: init-state up loglevel debug link_down = "em0.link.down" link_up = "em0.link.up" net = '( "ping -q -c 1 -t 1 XXX.XXX.XXX.XXX > /dev/null" every 10 && \ "ping -q -c 1 -t 1 XXX.XXX.XXX.XXX > /dev/null" every 10)' state auto { if $link_up { set-state up } if $link_down { set-state down } } state up { init { run "ifconfig em0 up" } } state down { init { run "ifconfig em0 down" } } (of course i put the real IPs in the file :) )but running ifstated -nv i obtain: /usr/local/etc/ifstated.conf:1: syntax error link_down = "em0.link.down" link_up = "em0.link.up" net = "( "ping -q -c 1 -t 1 XXX.XXX.XXX.XXX > /dev/null" every 10 && "ping -q -c 1 -t 1 XXX.XXX.XXX.XXX > /dev/null" every 10)" /usr/local/etc/ifstated.conf:14: syntax error /usr/local/etc/ifstated.conf:17: syntax error /usr/local/etc/ifstated.conf:23: syntax error /usr/local/etc/ifstated.conf:26: syntax error /usr/local/etc/ifstated.conf:31: syntax error /usr/local/etc/ifstated.conf:34: syntax error I checked against the provided sample file and everything looks ok to me; have someone some suggestion on how to make ifstated work or on some better mechanins to use? Thx Ivan >From: "N. Ersen SISECI" <siseci@gmail.com> >To: Evil I_Am <evil_ftw@hotmail.com> >Subject: Re: Automatic interface down >Date: Mon, 20 Mar 2006 12:06:23 +0200 > >Hi, > >You may try net/ifstated port. > > >-- >N. Ersen SISECI >http://www.enderunix.org > > >Pts, 2006-03-20 tarihinde 10:53 +0100 saatinde, Evil I_Am yazdı: > > > Hi > > I'd like to know if there is a way to automatically put a net interface >down > > when the cable is unplugged. I know i could make a cronned job to check >for > > it periodically,but i see this as a last restort > > > > Hi and thx > > Ivan > > > > > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to >"freebsd-questions-unsubscribe@freebsd.org" > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BAY104-F33155FF968DFE803378911E3DB0>