Update uptime.cr

Shorten the code 👍
This commit is contained in:
MooCat 2024-10-22 00:04:10 -04:00 committed by GitHub
parent d4834dcb3e
commit 0ca21d0b3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,10 +7,7 @@ class Invidious::Uptime
if CONFIG.uptime_enabled if CONFIG.uptime_enabled
# get the uptime # get the uptime
uptime_cmd = "/usr/bin/uptime" str_uptime = `/usr/bin/uptime -p`
uptime_args = "-p"
process = Process.new(uptime_cmd, [uptime_args], output: Process::Redirect::Pipe)
str_uptime = process.output.gets_to_end
else else
str_uptime = "" str_uptime = ""