diff --git a/libifupdown/lifecycle.c b/libifupdown/lifecycle.c index 9004e3f..d8ab8c5 100644 --- a/libifupdown/lifecycle.c +++ b/libifupdown/lifecycle.c @@ -25,6 +25,7 @@ #include "libifupdown/lifecycle.h" #include "libifupdown/state.h" #include "libifupdown/tokenize.h" +#include "libifupdown/config-file.h" static bool handle_commands_for_phase(const struct lif_execute_opts *opts, char *const envp[], const struct lif_interface *iface, const char *phase) @@ -240,6 +241,10 @@ lif_lifecycle_run_phase(const struct lif_execute_opts *opts, struct lif_interfac if (!handle_commands_for_phase(opts, envp, iface, phase)) goto handle_error; + /* if we don't need to support /etc/if-X.d we're done here */ + if (!lif_config.allow_addon_scripts) + goto out_free; + /* Check if scripts dir for this phase is present and bail out if it isn't */ struct stat dir_stat; char dir_path[4096];