You are not logged in.

#1 2012-04-24 02:03:38

GutenYe
Member
From: China
Registered: 2011-11-27
Posts: 44
Website

netcfg before/after interface up/down

I want to start or stop openvpn and ddclient after interface is up or down.

from the wiki, I got PRE_UP, POST_UP, PRE_DOWN, POST_DOWN variables, but I don't know where to put them to make it works.

the nearest thing I can get is put them into /etc/network.d/interfaces/{wlan0, eth0,...} or put them into /usr/lib/network/hooks.

thanks.


Linux, Vim, Ruby, Javascript and Go.

Offline

#2 2012-04-24 03:19:07

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: netcfg before/after interface up/down

So what's the problem?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2012-04-24 05:20:31

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: netcfg before/after interface up/down

You put those statements in the actual netcfg profile (/etc/network.d/<profilename>)


Burninate!

Offline

#4 2012-04-24 07:40:28

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: netcfg before/after interface up/down

Gcool wrote:

You put those statements in the actual netcfg profile (/etc/network.d/<profilename>)

The locations he mention work as well. Hence my question.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#5 2012-04-24 09:38:11

GutenYe
Member
From: China
Registered: 2011-11-27
Posts: 44
Website

Re: netcfg before/after interface up/down

I have a lot of  profiles, but don't want to write them again and agian,  Is there a easy to do it?


Linux, Vim, Ruby, Javascript and Go.

Offline

#6 2012-04-25 00:54:55

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: netcfg before/after interface up/down

Did you try the locations you mentioned in your first post?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#7 2012-04-25 02:22:56

GutenYe
Member
From: China
Registered: 2011-11-27
Posts: 44
Website

Re: netcfg before/after interface up/down

I put them into  /usr/lib/network/hooks now. Although it's not a best solution to put configuration files into /usr/lib/, but it's the best way to do it right now.

[SOLVED] thanks for all your replies.

[UPDATE] I also found an issue about it at https://bugs.archlinux.org/task/27496?s … &closedto=, it suggests use /etc/network.d/hooks instead.

Last edited by GutenYe (2012-04-25 02:27:31)


Linux, Vim, Ruby, Javascript and Go.

Offline

#8 2012-04-25 02:33:25

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: netcfg before/after interface up/down

Didn't it work with /etc/network.d/interfaces/{eth0,wlan0}?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#9 2012-04-25 02:40:30

GutenYe
Member
From: China
Registered: 2011-11-27
Posts: 44
Website

Re: netcfg before/after interface up/down

maybe it works. I'm not tested. I'm a laptop user, so I still need configure them both in /etc/network.d/interfaces/eth0 and /etc/network.d/interfaces/wlan0. /etc/network.d/interfaces is for per interface configuration, while /etc/network/hooks is for hooks. (I symbolic link them into /usr/lib/network/hooks). And I prefer the hooks way.


Linux, Vim, Ruby, Javascript and Go.

Offline

Board footer

Powered by FluxBB