static void exec_printer_daemons(int call_fw) { int i, has_printer = 0; char *opt_printer_script = "/opt/bin/on_hotplug_printer.sh"; char dev_lp[16]; for (i = 0; i < 10; i++) { sprintf(dev_lp, "/dev/usb/lp%d", i); if (check_if_dev_exist(dev_lp)) { has_printer = 1; if (call_fw) { if (check_if_file_exist(opt_printer_script)) doSystem("%s %s", opt_printer_script, dev_lp); } start_p910nd(dev_lp); } } if (has_printer) { #if defined(SRV_U2EC) start_u2ec(); #endif #if defined(SRV_LPRD) start_lpd(); #endif } }
void u2ec_processcheck(void) { u2ec_timer = (u2ec_timer + 1) % 3; if (u2ec_timer) return 1; if (nvram_match("apps_u2ec_ex", "1") && (!pids("u2ec") || !pids("lpd"))) { stop_u2ec(); stop_lpd(); start_u2ec(); start_lpd(); } }