The man page (man 5 ifcfg) states
PRE_UP_SCRIPT, POST_UP_SCRIPT, PRE_DOWN_SCRIPT and POST_DOWN_SCRIPT
Here you can hook a script (better: an executable) or systemd service name to perform individual actions before/after the interface is set up or before/after the interface is set down by
specifying the script names in a space separated list.
Wicked supports multiple schemes for the scripts.
- systemd:<service.name>" scheme:
Permits a service name or template which will be completed with interface name as its argument, e.g.:
POST_UP_SCRIPT="systemd:my-eth-post-up.service"
POST_UP_SCRIPT="systemd:my-post-up@.service"
On pre-up and post-up actions the service is started, on pre-down and post-down the service will be stopped.
The service should make use of an device service unit binding BindsTo=sys-subsystem-net-devices-%i.device so it gets stopped, when the device suddenly disappears. See also man sys-
temd.unit(5).
- wicked:<script> scheme:
Permits to specify a script or script directory either as an absolute path or relative to the /etc/wicked/scripts directory, e.g.:
POST_UP_SCRIPT="wicked:post-up"
POST_UP_SCRIPT="wicked:post-up/script1"
POST_UP_SCRIPT="wicked:/path/to/my-script-or-dir"
The script is executed as "$script $action $interface" with the pre-up, post-up, pre-down, post-down actions corresponding with the variable name.
- compat:suse:<script> scheme:
Permits to specify a script or script directory either as an absolute path or relative to the /etc/sysconfig/network/scripts directory, e.g.:
POST_UP_SCRIPT="compat:suse:post-up-script1"
POST_UP_SCRIPT="compat:suse:/path/to/my-script-or-dir"
The script is executed as "$script $interface $interface -o $action" with the pre-up, post-up, pre-down, post-down actions corresponding with the variable name.
Note: The script scheme must be specified as a safeguard to not execute any old and not-compatible sysconfig ifup scripts (which may depend on different files, internal state, ...). Once the
script has been adopted, prepend e.g. the "compat:suse:" scheme to activate.