Skip to content

Instantly share code, notes, and snippets.

@garthhumphreys
Created March 5, 2018 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garthhumphreys/a3c505b5918a6ccebd9b2cc03bf40e26 to your computer and use it in GitHub Desktop.
Save garthhumphreys/a3c505b5918a6ccebd9b2cc03bf40e26 to your computer and use it in GitHub Desktop.
Fab maintenance-mode script
# One for renaming the toggle file from 'maintenance-mode-off' to 'maintenance-mode-on', this will turn on the maintenance mode the next time someone refreshes the page or clicks on a link
def mm_on():
with cd('~/path/to/where/your/toggle/file/is/located/on/the/server'):
run('mv maintenance-mode-off maintenance-mode-on')
# And this command turns the maintenance mode off, again by renaming the "toggle file".
def mm_off():
with cd('~/path/to/where/your/toggle/file/is/located/on/the/server'):
run('mv maintenance-mode-on maintenance-mode-off')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment