Add hostname to modem down log file name
Add hostname to modem down log file name
Consider adding the hostname to the file name created by the /admin/download_modem_log.php process. Currently the filename is simply patterned "Pi-Star_MMDVM-yyyy-mm-dd" but the hostname (e.g Pi-Star-1, Pi-Star-2, etc) should be included to further delineate the source of the file.
Re: Add hostname to modem down log file name
Good idea - done deal.
Re: Add hostname to modem down log file name
Great!
FWIW, this is the change I worked up for this modification:
sed -i 's% $unixfile);%$unixfile);\n\texec("cat /etc/hostname",$output);\n\t$hostname = strtoupper($output[0])."_".basename($logfile);%'
sed -i 's%Pi-Star_\x27.basename($logfile)%\x27.$hostname%'
FWIW, this is the change I worked up for this modification:
sed -i 's% $unixfile);%$unixfile);\n\texec("cat /etc/hostname",$output);\n\t$hostname = strtoupper($output[0])."_".basename($logfile);%'
sed -i 's%Pi-Star_\x27.basename($logfile)%\x27.$hostname%'
- Attachments
-
- Modem File Download.jpg (60.59 KiB) Viewed 2648 times
Re: Add hostname to modem down log file name
Nevermind. Your solution is clearner/clearer!
I notice whenever a change is rolled out that overwrites something I've modified that the callsign reverts back to M1ABC and the language gets changed to English_UK. The callsign doesn't actually get changed in the config file so simply reapplying that section restores everything back to normal. It seems like the update log isn't reflecting exactly what is going on here in these situations.
I notice whenever a change is rolled out that overwrites something I've modified that the callsign reverts back to M1ABC and the language gets changed to English_UK. The callsign doesn't actually get changed in the config file so simply reapplying that section restores everything back to normal. It seems like the update log isn't reflecting exactly what is going on here in these situations.
Re: Add hostname to modem down log file name
Seems like the "hostname" should replace the "Pi-Star_" prefix to the filename. My downloads come out looking a little redundant (wordy?): "Pi-Star_pi-star-1_MMDVM...." rather than "pi-star-1_MMDVM..".
Re: Add hostname to modem down log file name
They follow the same standard as the config downloads - so they should all come out "Pi-Star_" then whatever it is, including the name of the log etc.
So - yes its a little wordy, but I'd prefer to think of it as descriptive