Changeset 1388
- Timestamp:
- 01/31/10 18:01:10 (14 years ago)
- Location:
- branches/monitor-improvement
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/oscam-http.c
r1387 r1388 1276 1276 } 1277 1277 1278 void send_oscam_scanusb(struct templatevars *vars, FILE *f){ 1279 FILE *fp; 1280 int err=0; 1281 char path[1035]; 1282 1283 /* Open the command for reading. */ 1284 fp = popen("lsusb", "r"); 1285 if (fp == NULL) { 1286 tpl_addVar(vars, 0, "USBENTRY", "Failed to run lusb"); 1287 tpl_printf(vars, 0, "USBENTRY", "%s", path); 1288 tpl_addVar(vars, 1, "USBBIT", tpl_getTpl(vars, "SCANUSBBIT")); 1289 err = 1; 1290 } 1291 1292 /* Read the output a line at a time - output it. */ 1293 if(!err){ 1294 while (fgets(path, sizeof(path)-1, fp) != NULL) { 1295 tpl_printf(vars, 0, "USBENTRY", "%s", path); 1296 tpl_addVar(vars, 1, "USBBIT", tpl_getTpl(vars, "SCANUSBBIT")); 1297 printf("Entry: %s\n",path); 1298 } 1299 } 1300 /* close */ 1301 pclose(fp); 1302 fputs(tpl_getTpl(vars, "SCANUSB"), f); 1303 } 1304 1278 1305 int process_request(FILE *f, struct in_addr in) { 1279 1306 … … 1317 1344 "/savetemplates.html", 1318 1345 "/shutdown.html", 1319 "/script.html"}; 1346 "/script.html", 1347 "/scanusb.html"}; 1348 1320 1349 int pagescnt = sizeof(pages)/sizeof(char *); // Calculate the amount of items in array 1321 1350 … … 1427 1456 case 6: send_oscam_services(vars, f, ¶ms, in); break; 1428 1457 case 7: send_oscam_user_config_edit(vars, f, ¶ms, in); break; 1458 //case 8: css file 1429 1459 case 9: send_oscam_services_edit(vars, f, ¶ms, in); break; 1430 1460 case 10: send_oscam_savetpls(vars, f); break; 1431 1461 case 11: send_oscam_shutdown(vars, f, ¶ms); break; 1432 1462 case 12: send_oscam_script(vars, f); break; 1463 case 13: send_oscam_scanusb(vars, f); break; 1433 1464 default: send_oscam_status(vars, f, ¶ms, in); break; 1434 1465 } -
branches/monitor-improvement/oscam-http.h
r1387 r1388 425 425 ##TPLMENU##\n\ 426 426 <BR><BR>\n\ 427 <TABLE CLASS=\"configmenu\"><TR><TD CLASS=\"configmenu\"><A HREF=\"scanusb.html\">Scan USB</A></TD></TR></TABLE><BR>\ 427 428 <TABLE cellspacing=\"0\" cellpadding=\"10\">\n\ 428 429 <TR>\n\ … … 445 446 446 447 #define TPLREADERREFRESHBIT "<A HREF=\"readers.html?action=reread&ridx=##RIDX##\" TITLE=\"Refresh Entitlement\"><IMG SRC=\"##REFRICO##\" BORDER=\"0\" ALT=\"Refresh Entitlement\"/></A>" 448 449 #define TPLSCANUSB "\ 450 ##TPLHEADER##\ 451 ##TPLMENU##\n\ 452 <BR><BR>\n\ 453 <TABLE cellspacing=\"0\" cellpadding=\"10\">\n\ 454 <TR><TH>USB Devices</TH></TR>\n\ 455 ##USBBIT##\n\ 456 </TABLE>\n\ 457 ##TPLFOOTER##" 458 459 #define TPLSCANUSBBIT "<TR><TD>##USBENTRY##</TD></TR>\n" 447 460 448 461 #define TPLENTITLEMENTS "\ … … 1000 1013 "READERSBIT", 1001 1014 "READERREFRESHBIT", 1015 "SCANUSB", 1016 "SCANUSBBIT", 1002 1017 "ENTITLEMENTS", 1003 1018 "READERCONFIG", … … 1068 1083 TPLREADERSBIT, 1069 1084 TPLREADERREFRESHBIT, 1085 TPLSCANUSB, 1086 TPLSCANUSBBIT, 1070 1087 TPLENTITLEMENTS, 1071 1088 TPLREADERCONFIG,
Note:
See TracChangeset
for help on using the changeset viewer.