5 int execScript(std::string
const& script
, std::string
const& ifname
)
11 for (fd
=getdtablesize();fd
>=0;--fd
) // close all file descriptors
13 fd
=open("/dev/null",O_RDWR
); // stdin
16 return execl("/bin/sh", "/bin/sh", script
.c_str(), ifname
.c_str(), NULL
);
19 waitpid(pid
, &status
, 0);