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" <[EMAIL PROTECTED]>
To: Evil I_Am <[EMAIL PROTECTED]>
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 "[EMAIL PROTECTED]"




_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to