OC-Tsuki/coreutils/shutdown.lua

10 lines
218 B
Lua
Raw Normal View History

2020-06-02 16:23:58 +10:00
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