From 7627174884fceb5d349ae2a1abc86c6dee8e33fe Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 29 Jan 2008 15:36:02 +0000 Subject: [PATCH] rfe: maintenance - turn on/off maintenance mode from the command line --- docs/changelog/7.x.x.txt | 1 + sbin/maintenanceMode.pl | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 sbin/maintenanceMode.pl diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6de3cc697..d4e66e983 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.5.1 + - rfe: maintenance - turn on/off maintenance mode from the command line - fix: RSS missing in message (perlDreamer Consulting, LLC.) http://www.plainblack.com/bugs/tracker/rss-missing-in-message - fix: Friends language error (perlDreamer Consulting, LLC.) diff --git a/sbin/maintenanceMode.pl b/sbin/maintenanceMode.pl new file mode 100644 index 000000000..89abaf7a5 --- /dev/null +++ b/sbin/maintenanceMode.pl @@ -0,0 +1,61 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2005 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + + +our ($webguiRoot); + +BEGIN { + $webguiRoot = ".."; + unshift (@INC, $webguiRoot."/lib"); +} + +use Getopt::Long; +use strict; +use WebGUI::Session; + +my $help; +my $start = 1; +my $stop = 0; +my $configFile; + +GetOptions( + 'help'=>\$help, + 'start'=>\$start, + 'stop'=>\$stop, + 'configFile=s'=>\$configFile + ); + +if ($help || $configFile eq ""){ + print <open($webguiRoot,$configFile); +$session->setting->remove('specialState'); +$session->setting->add('specialState','upgrading') unless $stop; +$session->var->end; +$session->close; +