import v0.1
[oweals/mountd.git] / main.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4 #include <sys/types.h>
5
6 #include "include/log.h"
7 #include "include/sys.h"
8 #include "include/timer.h"
9 #include "include/autofs.h"
10 #include "include/led.h"
11
12 int daemonize = 0;
13
14 int main(int argc, char *argv[])
15 {
16         daemon(0,0);
17         daemonize = 1;
18         log_start();
19         log_printf("Starting OpenWrt (auto)mountd V1\n");
20         timer_init();
21         led_init(0);
22         if (geteuid() != 0) {
23                 fprintf(stderr, "This program must be run by root.\n");
24                 return 1;
25         }
26         return autofs_loop();
27 }