whereami.conf is the file that determines what actions are taken based on which network you are on as determined in detect.conf. Each line in whereami.conf starts with a +, -, or = sign. A + means the command is performed when moving from another network to the new network; a - means the perform it when moving away, and the equal means to always perform it when using the network. The +/-/= sign must be followed by a network (which must be listed in detect.conf) and then a command. So, a line looks like this
Code:
+/-/=<network> <command>
My whereami.conf file looks like this:
Code:
=home-wired cp /etc/network/interfaces /etc/network/interfaces.old
=home-wired cp /etc/network/interfaces.wired /etc/network/interfaces
=home-wired /etc/init.d/networking restart
=home-wired setresolver search lucifer.blueplazma.org blueplazma.org nameserver 192.168.1.114
=wired cp /etc/network/interfaces /etc/network/interfaces.old
=wired cp /etc/network/interfaces.wired /etc/network/interfaces
=wired /etc/init.d/networking restart
=wired /etc/init.d/firewall-secure
=home-wireless cp /etc/network/interfaces /etc/network/interfaces.old
=home-wireless cp /etc/network/interfaces.home-wireless /etc/network/interfaces
=home-wireless /etc/init.d/networking restart
=home-wireless setresolver search lucifer.blueplazma.org blueplazma.org nameserver 192.168.1.114
=home-wireless /etc/init.d/firewall-home
=wireless cp /etc/network/interfaces /etc/network/interfaces.old
=wireless cp /etc/network/interfaces.dhcp-wireless /etc/network/interfaces
=wireless /etc/init.d/networking restart
=wireless dhclient
=wireless /etc/init.d/firewall-secure
=down cp /etc/network/interfaces /etc/network/interfaces.old
=down cp /etc/network/interfaces.down /etc/network/interfaces
=down /etc/init.d/networking restart
As you can see, I have several different networks, and different commands for each one. This file makes whereami very powerful, because just about any command can be executed based on the network whereami detects. For example, it is possible to automatically create a VPN connection with whereami and some knowhow with the VPN connection. I have not tried this, but see no reason why it would not work... If anyone does get it, let me know. I hope this helps you.
Bookmarks