#include<time.h> // in the include section // in the variable declaration section char * out_file_name = NULL ; FILE * out_fn = NULL ; time_t the_time ;
while ((ch = getopt(argc, argv, "vp:lf:")) != -1) { // change
// add somewhere in the switch body
case 'f':
out_file_name = strdup(optarg) ;
break ;
if (out_file_name) {
out_fn = fopen(out_file_name, "a");
if (!out_fn) {
perror("fopen") ;
exit(1) ;
}
}
// see https://en.cppreference.com/w/c/chrono/ctime
if (out_fn) {
time(&the_time) ;
fprintf(out_fn,"%sserver starting ...", ctime(&the_time)) ;
fflush(out_fn) ;
}
if (out_fn) {
fprintf(out_fn,"packet sent, %d bytes\n", bytes_sent) ;
fflush(out_fn) ;
}
<!--#echo var="DATE_LOCAL" --> <!--#include file=netbounce-log.txt -->
sudo a2enmod include
<Directory /var/www/>
Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
DirectoryIndex index.html index.shtml
</Directory>
sudo systemctl restart apache2

author: burton rosenberg
created: 8 feb 2024
update:8 jan 2024