Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function shutdownScreen(reboot)
- -- Run the Bitlocker set password command
- local function runBitlocker()
- print("Setting Bitlocker password...")
- local result, errorMsg = pcall(function()
- shell.run("bitlocker set password")
- end)
- if not result then
- print("Error while running Bitlocker: " .. errorMsg)
- end
- end
- -- Run the Bitlocker command
- runBitlocker()
- -- Display message that the machine can be safely turned off
- print("You can safely turn off the machine.")
- -- Perform shutdown or reboot based on the parameter
- if reboot then
- os.reboot() -- Trigger the reboot
- else
- os.shutdown() -- Trigger the shutdown
- end
- end
- -- Override os shutdown and reboot functions
- function os.shutdown()
- shutdownScreen(false)
- end
- function os.reboot()
- shutdownScreen(true)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement