[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Daemon program that runs scripts when a service become available.

On 07/01/2013 08:19 AM, Karl E. Jorgensen wrote:
On Mon, Jul 01, 2013 at 02:11:06PM +0100, Franco Martelli wrote:
This is my network situation, recently I bought a 3G router providing
internet connection to my network (an amd64 Desktop PC with Wheezy and
a Linksys NSLU2 de-underclocked with armel Squeeze). I would like to
run some scripts when 3G router gets connected to the Internet.
Using nmap program I notice that a TCP/IP service become available as
soon as 3G router gets connected so I thought to use it as a trigger
for a daemon program that checks an IP address for available services
then automatically it runs scripts.
Does it exist such a daemon program out there? Should I write a shell
script using some network utility?
apt-get install whereami

this can run shell commands/scripts based on your network location to
set up your machine for whatever network you end up on.

Generally, this is triggered by the presence of "link light", wireless
access points, ip/mac addresses reachable etc, so this should suit
you.  But I do not think it will cover the corner cases where the
remote service is re-started...

Most of the stuff can be taken care of by DHCP itself, but if you want
to e.g. change your default SMTP gateway, reconfigure local proxy, do
custom "stuff", then whereami does come in handy.

Hope this helps

monit is a very versatile daemon for monitoring for all sorts of conditions on local files, remote ports etc and can execute any command you give it when a certain condition is met.

Reply to: