local tArgs = {...} local err = true local reboot = false local poweroff = false local halt = false local remTemp = true local function findArg(arg) for _,v in ipairs(tArgs) do if v == arg then return true end end return false end if findArg("-r") or findArg("--reboot") then err = false reboot = true end if findArg("-p") or findArg("--poweroff") then err = false poweroff = true end if findArg("-h") or findArg("--halt") then err = false halt = true end if #tArgs < 1 or err then kerneldraw.printAppInfo("shutdown", "Arguments not specified") return end if reboot then kernel.reboot(remTemp) elseif poweroff then kernel.poweroff(remTemp) elseif halt then kernel.halt() end