NetProfile

What does it do?

It can remember network interface setups and load them. There is no fancy GUI tool for it yet, but it can be used as minimalistic network profiler (or, at last, I use it as so).

System logic

It uses four types of objects.

Scripts

Script (in Perl) is the power of the change. There must be scripts that turn on and off the network interfaces, take care of firewalls and like that.

Category

Category, or the network interface, is the thing that can be set up to some state or turned off. It is the network card it most cases, but the manager does not care what it is, so you can use it for anything you like.

Profile

Profile represents one given setup of some category. Any given profile can belong to one or more categories.

Profile consists of scripts turning it on and off, list of categories it can be applied to and a value list as a configuration.

State

State is a list of all categories turned on with their profiles.

Anatomy

The central component is a server, which runs with administrator rights, runs the scripts and remembers actual state. It communicates trough an unix socket on the file system (with rights for the "wheel" group).

Then there is client, which acts like a telnet to that socket and few bash scripts for more convenient use. Every "wheel" user can change the network settings.

Documentation

There is no such thing, as it would probably be longer than the code itself. So read the code, if you want to know how it works.

Known problems

First, it handles only one connection at a time, so there is no way how to do multiple requests at the same time. Furthermore, if someone kills the client, the server dies too.

Distribution

You can download it here.

It is under GNU GPL2 licence, so you can change and publish it, if you think it is worth it.