-/*
- 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 */
-
- if(netname)
- {
- asprintf(&s, "NETNAME=%s", netname);
- putenv(s); /* Don't free s! see man 3 putenv */
- }
-#ifdef HAVE_UNSETENV
- else
- {
- unsetenv("NETNAME");
- }
-#endif
-
- chdir(confbase); /* This cannot fail since we already read config files from this directory. */
-
- asprintf(&scriptname, "%s/%s", confbase, name);
- 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)