MindYourNeighbors

Launching scripts depending on you direct neighbors

How ?

MindYourNeighbors basically parse the ip-neighbor and, if results are found that are not excluded by the configuration, a configured command will be launched once.

Why ?

The original use case :

A linux box used as a router as well as a home server. On this box runs several pieces of software which can be very bandwith consuming (ie: transmission). I wanted to shut down this software when other users were using the network.

Features

MindYourNeighbors behavior's can be controlled through configuration file placed either in ~/.config/mind_your_neighbords.conf or in /etc/mind_your_neighbords.conf.

The configuration file is organized in sections. The DEFAULT section holds the default options which will be inherited by all the other sections (except for the logging level and the cache file path). All the other section will be read one by one ; each time the condition defined in filter_on is matched and isn't excluded by those defined in exclude the cache will be filled with either a marker neighbor or a marker no neighbor.

Cache length can't exceed the threshold, as only the REACHABLE lines in the result of the ip neigh command are taken in account and as those lines vary quite a bit, the threshold parameter allows you to configure how quickly a change of state can occure.

When the cache is filled the only neighbor or no neighbor markers, the corresponding command is executed once.

Options list

Default section options

By sections, overridable options