How can I programmatically change the system's status? I have a console controller action that needs to change the site's status under certain conditions. I have not been able to find any documentation or even questions out there about how to do this. Is it even possible?
There are two existing console commands you can use, ./craft on and ./craft off (on and off).
If you want/need to implement your own, take a look at the commit.