root/tags/omega-1.0.0-rc2/engine/setup/reset-setup

Revision 488, 2.1 KB (checked in by malte, 21 months ago)
Line 
1#!/usr/bin/perl
2
3# ISPCP ω (OMEGA) - Virtual Hosting Control System | Omega Version
4# Copyright (c) 2006-2007 by ispCP | http://isp-control.net
5#
6#
7# License:
8#    This program is free software; you can redistribute it and/or
9#    modify it under the terms of the GPL General Public License
10#    as published by the Free Software Foundation; either version 2.0
11#    of the License, or (at your option) any later version.
12#
13#    This program is distributed in the hope that it will be useful,
14#    but WITHOUT ANY WARRANTY; without even the implied warranty of
15#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16#    GPL General Public License for more details.
17#
18#    You may have received a copy of the GPL General Public License
19#    along with this program.
20#
21#    An on-line copy of the GPL General Public License can be found
22#    http://www.fsf.org/licensing/licenses/gpl.txt
23#
24########################################################################
25#
26# This Script only resetts the ISPCP Setup, it WON'T uninstall ISPCP!!
27# Afterwards a new install is possible. Use it, if you had an installation
28# error during setup.
29#
30# Keep attention: The ISPCP database will be deleted with all its content!
31#
32########################################################################
33
34use FindBin;
35use lib "$FindBin::Bin/..";
36require 'ispcp_common_code.pl';
37use strict;
38use warnings;
39
40## Variables
41my ($rs, $sql, $rdata)  = (undef, undef, undef);
42my $user_prefix = $main::cfg{'APACHE_SUEXEC_USER_PREF'};
43my $master_user = $main::cfg{'APACHE_SUEXEC_MIN_UID'};
44my $user_delete = $main::cfg{'CMD_USERDEL'};
45my $database    = $main::cfg{'DATABASE_NAME'};
46
47## MAIN
48print STDOUT "Re-setting ISPCP Setup!\n";
49print STDOUT "========================\n";
50my $delete_cmd = "$user_delete -r $user_prefix$master_user";
51$rs = sys_command($delete_cmd);
52
53my $delete_fcgi = "$main::cfg{'CMD_RM'} -r $main::cfg{'PHP_STARTER_DIR'}/master";
54$rs = sys_command($delete_fcgi);
55
56$sql = "DROP DATABASE IF EXISTS $database";
57($rs, $rdata) = doSQL($sql);
58if ($rs != 0) {
59        print STDOUT "An error occured!\n";
60        print STDOUT "$rdata\n";
61}
62else {
63        print STDOUT "done!\n";
64}
Note: See TracBrowser for help on using the browser.