/
stop.pl
54 lines (34 loc) · 1.14 KB
/
stop.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl -w
=head1 NAME
stop.pl - upgrade script to stop running Bricolage servers
=head1 VERSION
$LastChangedRevision$
=head1 DATE
$LastChangedDate$
=head1 DESCRIPTION
This script is called by "make upgrade" to stop running servers. Also
cleans out the Bricolage temp space since this has to be done after
the servers are stopped.
=head1 AUTHOR
Sam Tregar <stregar@about-inc.com>
=head1 SEE ALSO
L<Bric::Admin>
=cut
use strict;
use FindBin;
use lib "$FindBin::Bin/lib";
use Bric::Inst qw(:all);
use File::Spec::Functions qw(:ALL);
use Data::Dumper;
our $CONFIG;
do "./config.db" or die "Failed to read config.db : $!";
our $UPGRADE;
do "./upgrade.db" or die "Failed to read upgrade.db : $!";
print "\n\n==> Stopping Bricolage Servers <==\n\n";
# setup environment to ensure scripts run correctly
$ENV{BRICOLAGE_ROOT} = $UPGRADE->{BRICOLAGE_ROOT};
print "Stopping Bricolage Apache...\n";
system(catfile($CONFIG->{BIN_DIR}, "bric_apachectl"), "stop");
print "Clearing temp space in $CONFIG->{TEMP_DIR}/bricolage...\n";
system("rm", "-rf", catdir($CONFIG->{TEMP_DIR}, "bricolage"));
print "\n\n==> Finished Stopping Bricolage Servers <==\n\n";