function PrintCentered(text)
    local w, h = term.getSize()
    x = math.max(math.ceil((w / 2) - (#text / 2)), 0)
    y = math.max(math.ceil((h / 2)), 0)
    term.setCursorPos(x, y)
    print(text)
end

--add a message saying that the display has been moved to monitor
term.setBackgroundColor(colors.lightBlue)
term.setTextColor(colors.white)
term.clear()

PrintCentered("Shutting down, good bye.")
sleep(2)
os.shutdown()