-
Notifications
You must be signed in to change notification settings - Fork 0
Home
kimperator edited this page Jan 4, 2012
·
4 revisions
Welcome to the Samen wiki!
Samen stands for Small Action ManagEr for wireless Networks
It is a ultra small wpa_supplicant (wpa_cli) action handler.
Features are:
-
Simple to use
-
Extendable
-
Low memory footprint
-
Starting / stopping dhcp client as default actions
Samen needs no special configuration.
The decision whether if it uses the default action (dhcp) is given due to wpa_supplicant.conf.
If an id_str is set for the wlan network in wpa_supplicant.conf,
samen tries to execute /etc/samen/up-<id_str>.sh on connect and /etc/samen/down-<id_str>.sh on disconnect.
Examples:
wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
ap_scan=1
network={
ssid="myunsecurehome"
key_mgmt=NONE
id_str="home"
}
/etc/samen/up-home.sh
#first parameter is wireless interface
INTERFACE=$1
#sets ip to 10.10.0.100
ifconfig $INTERFACE 10.10.0.100
#adds default route to 10.10.0.1
route add default gw 10.10.0.1
#sets dns to 4.2.2.2
echo "nameserver 4.2.2.2" > /etc/resolv.conf
/etc/samen/down-home.sh
#first parameter is wireless interface
INTERFACE=$1
#unset ip
ifconfig $INTERFACE 0.0.0.0
#delete route
route del default
#delete dns server
echo > /etc/resolv.conf
Other Examples could be use curl to login on wireless hotspots or open ssh/vpn tunnels on unsecure networks
Be creative :)