printf(" -b, --bitrate <mbits/s>\n");
printf(" -o, --ofdm\n");
printf(" -s, --short-preamble\n");
+ printf(" -h, --help\n");
}
int main(int argc, char *argv[])
int ret;
forb_init_attr_t attr = { .orb_id = "org.frescor.frm.fwp" };
int opt;
+ bool opt_daemon = false;
+ char *opt_pidfile = NULL;
if (getenv("FWP_BYPASS"))
priv.bypass = true;
- while ((opt = getopt_long(argc, argv, "b:hl:os", &long_opts[0], NULL)) != EOF) {
- while ((opt = getopt_long(argc, argv, "b:l:hos", &long_opts[0], NULL)) != EOF) {
++ while ((opt = getopt_long(argc, argv, "b:d:hl:os", &long_opts[0], NULL)) != EOF) {
switch (opt) {
+ case 'd':
+ opt_daemon = true;
+ opt_pidfile = optarg;
+ break;
case 'l':
ul_log_domain_arg2levels(optarg);
break;
}
}
+ if (opt_daemon)
+ forb_daemon_prepare(opt_pidfile);
+
orb = forb_init(&argc, &argv, &attr);
if (!orb) error(1, errno, "forb_init");