4 Copyright (C) 2006-2009 Jonathan Zarate
10 void asp_upnpinfo(int argc
, char **argv
)
13 if (nvram_get_int("upnp_enable")) {
14 f_write_string("/etc/upnp/info", "", 0, 0);
15 if (killall("miniupnpd", SIGUSR2
) == 0) {
16 f_wait_notexists("/etc/upnp/info", 5);
19 web_puts("\nmupnp_data = '");
20 web_putfile("/etc/upnp/data.info", WOF_JAVASCRIPT
);
24 unlink("/var/spool/upnp.js");
25 if (nvram_get_int("upnp_enable") == 1) {
26 if (killall("upnp", SIGUSR2
) == 0) {
27 f_wait_exists("/var/spool/upnp.js", 5);
31 web_puts("\nupnp_data = [\n");
32 do_file("/var/spool/upnp.js");
34 unlink("/var/spool/upnp.js");
38 void wo_upnp(char *url
)
45 if (nvram_get_int("upnp_enable")) {
46 if (((proto
= webcgi_get("remove_proto")) != NULL
) && (*proto
) &&
47 ((eport
= webcgi_get("remove_eport")) != NULL
) && (*eport
)) {
48 sprintf(s
, "%3s %6s\n", proto
, eport
);
49 f_write_string("/etc/upnp/delete", s
, 0, 0);
50 if (killall("miniupnpd", SIGUSR2
) == 0) {
51 f_wait_notexists("/etc/upnp/delete", 5);
61 if (nvram_get_int("upnp_enable") == 1) {
62 if (((proto
= webcgi_get("remove_proto")) != NULL
) && (*proto
) &&
63 ((port
= webcgi_get("remove_ext_port")) != NULL
) && (*port
)) {
65 sprintf(s
, "%s %s\n", proto
, port
);
66 f_write_string("/var/spool/upnp.delete", s
, 0, 0);
67 if (killall("upnp", SIGUSR2
) == 0) {
68 f_wait_notexists("/var/spool/upnp.delete", 5);