busybox-1.32.0/networking/udhcp/dhcpc.c
static void udhcp_run_script(struct dhcp_packet *packet, const char *name)
{
	char **envp, **curr;
	char *argv[3];

	envp = fill_envp(packet);

	/* call script */
	log1("executing %s %s", client_data.script, name);
	argv[0] = (char*) client_data.script;
	argv[1] = (char*) name;
	argv[2] = NULL;
	spawn_and_wait(argv);

	for (curr = envp; *curr; curr++) {
		log2(" %s", *curr);
		bb_unsetenv_and_free(*curr);
	}
	free(envp);
}
/* Call a script with a par file and env vars */
Call a script with a par file and env vars
Call a script with a par file and env vars
static void udhcp_run_script(struct dhcp_packet *packet, const char *name)
{
	char **envp, **curr;
	char *argv[3];
	envp = fill_envp(packet);
	log1("executing %s %s", client_data.script, name);
	argv[0] = (char*) client_data.script;
	argv[1] = (char*) name;
	argv[2] = NULL;
	spawn_and_wait(argv);
	for (curr = envp; *curr; curr++) {
		log2(" %s", *curr);
		bb_unsetenv_and_free(*curr);
	}
	free(envp);
}
static void udhcp_run_script ( struct dhcp_packet * packet , const char * name ) { char * * envp , * * curr ; char * argv [ 3 ] ; envp = fill_envp ( packet ) ; log1 ( " " , client_data . script , name ) ; argv [ 0 ] = ( char * ) client_data . script ; argv [ 1 ] = ( char * ) name ; argv [ 2 ] = NULL ; spawn_and_wait ( argv ) ; for ( curr = envp ; * curr ; curr ++ ) { log2 ( " " , * curr ) ; bb_unsetenv_and_free ( * curr ) ; } free ( envp ) ; }
Call a script with a par file and env vars
Call a script with a par file and env vars
/* call script */