mirror of https://github.com/aredn/aredn.git
rename supportdata extention from tgz to gz (#427)
This commit is contained in:
parent
82b0cb5903
commit
55642e05be
|
@ -172,7 +172,7 @@ if f then
|
||||||
f:close()
|
f:close()
|
||||||
end
|
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
|
-- cleaup the temp files
|
||||||
remove_all("/tmp/sd")
|
remove_all("/tmp/sd")
|
||||||
|
|
||||||
|
@ -180,15 +180,15 @@ local nodename = capture("uname -n"):chomp()
|
||||||
local tstamp = capture("date +%Y%m%d%H%M"):chomp()
|
local tstamp = capture("date +%Y%m%d%H%M"):chomp()
|
||||||
|
|
||||||
if os.getenv("GATEWAY_INTERFACE") ~= "" then
|
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-type: application/x-gzip\r")
|
||||||
print("Content-Disposition: attachment; filename=" .. fn .. "\r")
|
print("Content-Disposition: attachment; filename=" .. fn .. "\r")
|
||||||
print("\r")
|
print("\r")
|
||||||
io.write(read_all("/tmp/supportdata.tgz"))
|
io.write(read_all("/tmp/supportdata.gz"))
|
||||||
else
|
else
|
||||||
local fn = "/tmp/supportdata-" .. nodename .. "-" .. tstamp .. ".tgz"
|
local fn = "/tmp/supportdata-" .. nodename .. "-" .. tstamp .. ".gz"
|
||||||
nixio.fs.remove(fn)
|
nixio.fs.remove(fn)
|
||||||
nixio.fs.rename("/tmp/supportdata.tgz", fn)
|
nixio.fs.rename("/tmp/supportdata.gz", fn)
|
||||||
print("File created: " .. fn)
|
print("File created: " .. fn)
|
||||||
print("Please copy this file and remove from the node")
|
print("Please copy this file and remove from the node")
|
||||||
print("to free up resources.")
|
print("to free up resources.")
|
||||||
|
|
Loading…
Reference in New Issue