#!/usr/bin/perl -w
#
# Script for TWiki Enterprise Collaboration Platform, http://TWiki.org/
#
# Copyright (C) 2013 Wave Systems Corp.
# Copyright (C) 2013 Peter Thoeny, peter[at]thoeny.org
# Copyright (C) 2013 TWiki Contributors
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. For
# more details read LICENSE in the root of this distribution.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html
#
# As per the GPL, removal of this notice is prohibited.
#
# Mail notification script, part of the WatchlistPlugin. You must
# add the TWiki bin dir to the search path for this script, so it
# can find the rest of TWiki, such as:
# perl -I /var/www/twiki/bin /var/www/twiki/tools/watchlistnotify

use strict;
use warnings;

BEGIN {
    $TWiki::cfg{Engine} = 'TWiki::Engine::CLI';
    require Carp;
    $SIG{__DIE__} = \&Carp::confess;
    $ENV{TWIKI_ACTION} = 'watchlistnotify';
    @INC = ('.', grep { $_ ne '.' } @INC);
    require 'setlib.cfg';
    $TWiki::cfg{SwitchBoard} ||= {};
    $TWiki::cfg{SwitchBoard}{watchlistnotify} =
      [ 'TWiki::Plugins::WatchlistPlugin',
        'watchlistNotify',
        { watchlistnotify => 1 }
      ];
}

use TWiki;
use TWiki::UI;
$TWiki::engine->run();

# EOF
