OC-Tsuki/coreutils/shutdown.lua

10 lines
218 B
Lua

if (kernel) then
if (os.getenv("_"):match("reboot.velx")) then
kernel.sig_push {sigtype = "reboot"}
else
kernel.sig_push {sigtype = "shutdown"}
end
else
io.stderr:write("must be run as root\n")
os.exit(-1)
end