mirror of https://github.com/aredn/aredn.git
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:
parent
23b634e6ac
commit
1f4fa46887
|
@ -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>;
|
||||
|
|
Loading…
Reference in New Issue