-/*
- Execute the given script.
- This function doesn't really belong here.
-*/
-int execute_script(const char* name)
-{
- char *scriptname;
- pid_t pid;
- char *s;
-
- if((pid = fork()) < 0)
- {
- syslog(LOG_ERR, _("System call `%s' failed: %m"),
- "fork");
- return -1;
- }
-
- if(pid)
- {
- return 0;
- }
-
- /* Child here */
-
- asprintf(&scriptname, "%s/%s", confbase, name);
- asprintf(&s, "IFNAME=%s", interface_name);
- putenv(s);
- free(s);
-
- if(netname)
- {
- asprintf(&s, "NETNAME=%s", netname);
- putenv(s);
- free(s);
- }
- else
- {
- unsetenv("NETNAME");
- }
-
- if(chdir(confbase) < 0)
- {
- syslog(LOG_ERR, _("Couldn't chdir to `%s': %m"),
- confbase);
- }
-
- execl(scriptname, NULL);
- /* No return on success */
-
- if(errno != ENOENT) /* Ignore if the file does not exist */
- syslog(LOG_WARNING, _("Error executing `%s': %m"), scriptname);
-
- /* No need to free things */
- exit(0);
-}
-
-int xsend(conn_list_t *cl, vpn_packet_t *inpkt)