View Single Post
Old 20th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default

Quote:
Originally Posted by jggimi View Post
If dhclient(8) is able to sense the NIC status is down, ifstated(8) should be able to obtain the same state information, and this should not require external scripting. Should.
Ooo, nice catch! /etc/ifstated.conf now reads:

Code:
init-state auto

wpi0_down = "wpi0.link.down"

state auto {
        if ! $wpi0_down {
              set-state if_online
        }
        if $wpi0_down {
              set-state if_offline
        }
}

state if_online {
        if $wpi0_down {
              set-state if_offline
        }
}

state if_offline {
        init {
             run "sh /etc/netstart wpi0"
         }
        if ! $wpi0_down {
             set-state if_online
        }
}
I'll live with it for a while and see how it works out
Reply With Quote