/usr/share/eiskaltdcpp/luascripts/uptime.lua is in eiskaltdcpp-scripts 2.2.9-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | --// vim:ts=4:sw=4:noet
--// uptime.lua -- Record uptime of script (and most likely, BCDC++)
if not uptime then
uptime = {}
uptime.start = os.time()
uptime.diff = function()
return os.difftime( os.time(), uptime.start )
end
uptime.format = function()
local s = uptime.diff()
local t = os.date( "!*t", s )
return string.format( "%i day(s) %02i:%02i:%02i",
s / 86400, t.hour, t.min, t.sec )
end
end
dcpp:setListener( "ownChatOut", "uptime",
function( hub, text )
local s = string.lower( text )
if text == "/uptime" then
hub:addLine( "Uptime: "..uptime.format() )
return 1
elseif text == "/uptime show" then
hub:sendChat( "My DC++ client uptime is: "..uptime.format() )
return 1
elseif string.sub(s, 1, 5) == "/help" then
hub:addLine( "(uptime.lua) /uptime [show]" )
return nil
end
end
)
DC():PrintDebug( " ** Loaded uptime.lua **" )
|