local ok, messages = pcall(dofile, "/opt/omorifortune/messages-dark.lua") if not ok then messages = dofile("/opt/omorifortune/messages-calm.lua") end local f = io.open("/dev/urandom", "rb") local seed = 0 if f then local bytes = f:read(4) if bytes then for i = 1, #bytes do seed = seed * 256 + bytes:byte(i) end end f:close() end math.randomseed(seed) local msg = messages[math.random(#messages)] local cow = "omori" local ok2, handle = pcall(io.popen, "cowsay -f " .. cow .. " 2>/dev/null", "w") if handle then handle:write(msg) handle:close() else print(msg) end