From 87c5b1867511f538ba44f57b50276eec533ccb44 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 27 Sep 2011 18:23:45 +0200 Subject: added simple check for mantainance/offline message --- index.py | 10 +++++----- templates/index.html | 13 ++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/index.py b/index.py index 44acc74..38ee86b 100755 --- a/index.py +++ b/index.py @@ -1,11 +1,10 @@ #!/usr/bin/env python -import sys -sys.path += ['/usr/lib/mailman'] - +import sys, os, re from web import template, form, application, ctx, wsgi, config from socket import gethostbyaddr, gethostbyname -import re + +sys.path += ['/usr/lib/mailman'] import Mailman.Utils valid_ips = [ @@ -61,7 +60,8 @@ create_form = form.Form( class index: def GET(self): - return render.index() + running = not os.path.exists('./offline') + return render.index(running) class spam: def GET(self): diff --git a/templates/index.html b/templates/index.html index 4322153..ef415b8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,5 @@ +$def with (running) + $var title: Mailinglisten $var headline: Willkommen auf dem Mailinglistenserver von @@ -68,8 +70,13 @@ $var headline:
system status:
- - +++ RUNNING +++ - + $if running: + + +++ RUNNING +++ + + $else: + + +++ MAINTENANCE / OFFLINE +++ +
-- cgit v1.2.3-1-g7c22