Update caddy.lua

This commit is contained in:
lmq8267 2024-01-21 16:52:07 +08:00 committed by GitHub
parent 038ae23a15
commit cfaf472a6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,8 +30,8 @@ function caddy_status()
local tagcontent = tagfile:read("*all") local tagcontent = tagfile:read("*all")
tagfile:close() tagfile:close()
if tagcontent and tagcontent ~= "" then if tagcontent and tagcontent ~= "" then
os.execute("start_time=$(cat /tmp/caddy_time) && time=$(($(date +%s)-start_time)) && day=$((time/86400)) && [ $day -eq 0 ] && day='' || day=${day}天 && time=$(date -u -d @${time} +'%H小时%M分%S秒') && echo $day $time > /tmp/command_output 2>&1") os.execute("start_time=$(cat /tmp/caddy_time) && time=$(($(date +%s)-start_time)) && day=$((time/86400)) && [ $day -eq 0 ] && day='' || day=${day}天 && time=$(date -u -d @${time} +'%H小时%M分%S秒') && echo $day $time > /tmp/command_caddy 2>&1")
local command_output_file = io.open("/tmp/command_output", "r") local command_output_file = io.open("/tmp/command_caddy", "r")
if command_output_file then if command_output_file then
e.caddysta = command_output_file:read("*all") e.caddysta = command_output_file:read("*all")
command_output_file:close() command_output_file:close()