[opensuse] Re: using if-{up,down}.d scripts
Carlos E. R. wrote:
On 09/05/2019 01.45, Patrick Shanahan wrote:
* Carlos E. R. <> [05-08-19 14:31]:
On 08/05/2019 20.14, Per Jessen wrote:
Carlos E. R. wrote:
The script will get parameters on the command line and environment, which I need. What is the man page? It is not "man wicked"
Dunno - put a script in and dump the environment and the arguments. If you google it, you'll probably find the information too.
Oh, I hoped you knew. Ok, one item more to my to-do list.
man wickedd ??
Unfortunately, no. I did apropos wicked and nothing seemed appropriate, but maybe I missed something, I only had a quick look and search.
man -k wicked Unfortunately that is not much help either. It seems I was not exactly 100% right when I wrote "the mechanisms haven't changed" ... they are much the same, but the config has changed :-( See "man 5 ifcfg" - skip to POST_UP_SCRIPT. -- Per Jessen, Zürich (9.2°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Per Jessen wrote:
It seems I was not exactly 100% right when I wrote "the mechanisms haven't changed" ... they are much the same, but the config has changed :-(
See "man 5 ifcfg" - skip to POST_UP_SCRIPT.
I added this line to /etc/sysconfig/network/config POST_UP_SCRIPT="compat:suse:/etc/sysconfig/network/if-up.d/carlos.sh" afaict, the "if-{up,down}.d/" location is not longer used. In the script I just dump the arguments and the environment and email it to myself. I received two emails, one for 'lo' and one for 'eth0'. eth0 eth0 -o post-up WICKED_OBJECT_PATH=/org/opensuse/Network/Interface/2 CONFIG=eth0 WICKED_RETFILE=/tmp/wicked.Bf9Vyx WICKED_INTERFACE_NAME=eth0 PWD=/ WICKED_INTERFACE_INDEX=2 INTERFACE=eth0 WICKED_ARGFILE=/tmp/wicked.o9HzdI SHLVL=2 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin _=/usr/bin/env -- Per Jessen, Zürich (9.3°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 09/05/2019 10.11, Per Jessen wrote:
Per Jessen wrote:
It seems I was not exactly 100% right when I wrote "the mechanisms haven't changed" ... they are much the same, but the config has changed :-(
See "man 5 ifcfg" - skip to POST_UP_SCRIPT.
I added this line to /etc/sysconfig/network/config
POST_UP_SCRIPT="compat:suse:/etc/sysconfig/network/if-up.d/carlos.sh"
afaict, the "if-{up,down}.d/" location is not longer used.
In the script I just dump the arguments and the environment and email it to myself. I received two emails, one for 'lo' and one for 'eth0'.
eth0 eth0 -o post-up WICKED_OBJECT_PATH=/org/opensuse/Network/Interface/2 CONFIG=eth0 WICKED_RETFILE=/tmp/wicked.Bf9Vyx WICKED_INTERFACE_NAME=eth0 PWD=/ WICKED_INTERFACE_INDEX=2 INTERFACE=eth0 WICKED_ARGFILE=/tmp/wicked.o9HzdI SHLVL=2 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin _=/usr/bin/env
I'll check on that later, but thanks :-) The current local IP is not there, that's a parameter I will need. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas))
Carlos E. R. wrote:
On 09/05/2019 10.11, Per Jessen wrote:
Per Jessen wrote:
It seems I was not exactly 100% right when I wrote "the mechanisms haven't changed" ... they are much the same, but the config has changed :-(
See "man 5 ifcfg" - skip to POST_UP_SCRIPT.
I added this line to /etc/sysconfig/network/config
POST_UP_SCRIPT="compat:suse:/etc/sysconfig/network/if-up.d/carlos.sh"
afaict, the "if-{up,down}.d/" location is not longer used.
In the script I just dump the arguments and the environment and email it to myself. I received two emails, one for 'lo' and one for 'eth0'.
eth0 eth0 -o post-up WICKED_OBJECT_PATH=/org/opensuse/Network/Interface/2 CONFIG=eth0 WICKED_RETFILE=/tmp/wicked.Bf9Vyx WICKED_INTERFACE_NAME=eth0 PWD=/ WICKED_INTERFACE_INDEX=2 INTERFACE=eth0 WICKED_ARGFILE=/tmp/wicked.o9HzdI SHLVL=2 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin _=/usr/bin/env
I'll check on that later, but thanks :-)
The current local IP is not there, that's a parameter I will need.
My guess is - it was deliberately omitted, because it could be multiple addresses, it could be different kinds. There is probably some sysfs interface, or maybe you'll have to parse output of 'ipaddr show dev nnn' -- Per Jessen, Zürich (15.3°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 09/05/2019 14.04, Per Jessen wrote:
Carlos E. R. wrote:
The current local IP is not there, that's a parameter I will need.
My guess is - it was deliberately omitted, because it could be multiple addresses, it could be different kinds. There is probably some sysfs interface, or maybe you'll have to parse output of 'ipaddr show dev nnn'
nm provides it to scripts. -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.0 (Legolas))
participants (2)
-
Carlos E. R.
-
Per Jessen