Thanks for all the input on this one - in the end I gave up and just added a line in my script that changes the link from the apache 'sites-enabled' file to point to a 'sites-available' file that loads up a maintenance html page I made myself.
General help
Moodle maintenance mode cli in a script
Hierdie bespreking is gesluit, dus kan jy nie meer daarop antwoord nie.