mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-24 22:50:47 -04:00
fix
This commit is contained in:
parent
faa639c031
commit
a47fb1f234
1 changed files with 19 additions and 0 deletions
19
src/invidious/helpers/uptime.cr
Normal file
19
src/invidious/helpers/uptime.cr
Normal file
|
@ -0,0 +1,19 @@
|
|||
class Invidious::Uptime
|
||||
|
||||
def self.get_uptime
|
||||
|
||||
str_uptime = "error"
|
||||
|
||||
# get the uptime
|
||||
uptime_cmd = "/usr/bin/uptime"
|
||||
uptime_args = "-p"
|
||||
|
||||
process = Process.new(uptime_cmd, [uptime_args], output: Process::Redirect::Pipe)
|
||||
|
||||
str_uptime = process.output.gets_to_end
|
||||
|
||||
return str_uptime
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue