+ if (!cmdexit) {
+ char *ptr;
+ time_t last_update = time(NULL);
+ while (ptr = fgets(buf, SIZ, sourcefp), (ptr != NULL)) {
+ ptr = strchr(buf, '\n');
+ if (ptr) *ptr = 0; // remove the newline character
+ ++linecount;
+ if (!strncasecmp(buf, "<progress>", 10)) {
+ printf("\033[11;0HPercent complete: \033[32m%d\033[0m\n", atoi(&buf[10]));
+ }
+ if (time(NULL) != last_update) {
+ last_update = time(NULL);
+ printf("\033[10;0H Lines received: \033[32m%d\033[0m\n", linecount);
+ }
+ serv_puts(local_admin_socket, buf);
+ }
+
+ serv_puts(local_admin_socket, "000");
+ }