extern char *lms_url;\r
extern char *log_dir;\r
extern char *ip6prefix;\r
+extern int traffic_detected;\r
\r
const char *tr_odd_even(void);\r
/* implemented in prometheus.c, shared with parselogs.c */\r
insert(sum,sums,order_by,i);\r
}\r
\r
- if(!just_preview)\r
+ if(!just_preview && traffic_detected)\r
{\r
append_log(ip);\r
for_each(sharedip,ips) if(eq(ip->name, sharedip->sharing))\r
extern int free_max;\r
extern int include_upload;\r
\r
+int traffic_detected = 0;\r
+\r
/* ===================== traffic analyser - uses iptables ================ */ \r
\r
void get_traffic_statistics(const char *whichiptables, int ipv6)\r
{\r
char *str,*cmd;\r
- int downloadflag=0;\r
+ int downloadflag = 0;\r
+ traffic_detected = 0;\r
\r
textfile(Pipe,str) *line,*lines=NULL;\r
string(str,STRLEN);\r
else\r
{\r
sscanf(ptr,"%Lu",&traffic); \r
+ if(traffic)\r
+ {\r
+ traffic_detected = 1;\r
+ }\r
traffic += (1<<19);\r
traffic >>= 20;\r
}\r