Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Perform an action when network cable unplugged (and back in again)
- Date: Wed, 13 Jun 2012 11:07:16 +0900
- From: Jawaad Mahmood <jawaad.mahmood@example.com>
- Subject: Re: [tlug] Perform an action when network cable unplugged (and back in again)
- References: <4FD7DDC0.9090701@dcook.org>
On Wed, Jun 13, 2012 at 9:24 AM, Darren Cook <darren@example.com> wrote:This looks promising at least..My notebook, running ubuntu 10.04, is almost all the time using a wired
connection, with static IP address. When I pull the network cable out of
my notebook (and then plug it in again) I see these entries in /etc/syslog:
Jun 12 09:04:45 myhost kernel: [479179.526691] r8169: eth0: link down
...
Jun 12 09:08:40 myhost kernel: [479414.948768] r8169: eth0: link up
What I'd like to do is run a command when we get link down (I'd like to
unmount a network drive), and run another command when we get link up
(remount the drive). Are there any hooks in linux for this? (I know we
have if-up.d and if-down.d for the interfaces, but those scripts are not
being run when just the cable is pulled out; I'm looking for the "link"
equivalent of those directories.)
Does such a thing even exist?
It does exist.I don't have time to program it for you right now, but it seems one can handle netlink socket connections through python:--
Sincerely yours,
Jawaad Mahmood
http://www.jawaadmahmood.com
080-4204-7198
- Follow-Ups:
- Re: [tlug] Perform an action when network cable unplugged (and back in again)
- From: Attila Kinali
- References:
Home | Main Index | Thread Index
- Prev by Date: [tlug] Perform an action when network cable unplugged (and back in again)
- Next by Date: Re: [tlug] Perform an action when network cable unplugged (and back in again)
- Previous by thread: [tlug] Perform an action when network cable unplugged (and back in again)
- Next by thread: Re: [tlug] Perform an action when network cable unplugged (and back in again)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links