rename supportdata extention from tgz to gz (#427)

This commit is contained in:
dman776 2022-07-06 15:27:08 -05:00 committed by GitHub
parent 82b0cb5903
commit 55642e05be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -172,7 +172,7 @@ if f then
f:close()
end
os.execute("tar -zcf /tmp/supportdata.tgz -C /tmp/sd ./")
os.execute("tar -zcf /tmp/supportdata.gz -C /tmp/sd ./")
-- cleaup the temp files
remove_all("/tmp/sd")
@ -180,15 +180,15 @@ local nodename = capture("uname -n"):chomp()
local tstamp = capture("date +%Y%m%d%H%M"):chomp()
if os.getenv("GATEWAY_INTERFACE") ~= "" then
local fn = "supportdata-" .. nodename .. "-" .. tstamp .. ".tgz"
local fn = "supportdata-" .. nodename .. "-" .. tstamp .. ".gz"
print("Content-type: application/x-gzip\r")
print("Content-Disposition: attachment; filename=" .. fn .. "\r")
print("\r")
io.write(read_all("/tmp/supportdata.tgz"))
io.write(read_all("/tmp/supportdata.gz"))
else
local fn = "/tmp/supportdata-" .. nodename .. "-" .. tstamp .. ".tgz"
local fn = "/tmp/supportdata-" .. nodename .. "-" .. tstamp .. ".gz"
nixio.fs.remove(fn)
nixio.fs.rename("/tmp/supportdata.tgz", fn)
nixio.fs.rename("/tmp/supportdata.gz", fn)
print("File created: " .. fn)
print("Please copy this file and remove from the node")
print("to free up resources.")