diff options
Diffstat (limited to 'modules/autostart/autostart.c')
| -rw-r--r-- | modules/autostart/autostart.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/autostart/autostart.c b/modules/autostart/autostart.c new file mode 100644 index 0000000..d947972 --- /dev/null +++ b/modules/autostart/autostart.c @@ -0,0 +1,18 @@ +void +runautostart(void) +{ + const char *const *cmd = autostart; + + if (fork() == 0) { + setsid(); + + while (*cmd != NULL) { + if (fork() == 0) { + execl("/bin/sh", "sh", "-c", *cmd, NULL); + exit(1); + } + cmd++; + } + exit(0); + } +} |
