supporttool: Add nodename and tsamp to default filename

add nodename and tstamp to default filename to reduce chance of submitting wrong file

timestamp may not always be 'real' time if a node does not have ntp access
This commit is contained in:
Conrad Lara - KG6JEI 2015-05-24 14:17:31 -07:00
parent 23b634e6ac
commit 1f4fa46887
1 changed files with 6 additions and 1 deletions

View File

@ -131,11 +131,16 @@ close ($CMDS_OUT);
system("tar", "-zcf", "/tmp/supportdata.tgz", "-C", "/tmp/sd", "./");
$nodename=`uname -n`;
chomp($nodename);
$tstamp=`date +%Y%m%d%H%M`;
chomp($tstamp);
open(my $SDFH, '<', "/tmp/supportdata.tgz") or exit(1);
binmode $SDFH;
print "Content-type: application/x-gzip\r\n";
print "Content-Disposition: attachment; filename=supportdata.tgz\r\n";
print "Content-Disposition: attachment; filename=supportdata-$nodename-$tstamp.tgz\r\n";
print "\r\n";
print while <$SDFH>;