| 1 |
#!/usr/bin/perl |
|---|
| 2 |
|
|---|
| 3 |
# ispCP ω (OMEGA) a Virtual Hosting Control Panel |
|---|
| 4 |
# Copyright (c) 2006-2008 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 resets 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 |
|
|---|
| 34 |
use FindBin; |
|---|
| 35 |
use lib "$FindBin::Bin/.."; |
|---|
| 36 |
require 'ispcp_common_code.pl'; |
|---|
| 37 |
use strict; |
|---|
| 38 |
use warnings; |
|---|
| 39 |
|
|---|
| 40 |
## Variables |
|---|
| 41 |
my ($rs, $sql, $rdata, $delete_cmd ) = (undef, undef, undef,undef ); |
|---|
| 42 |
my $user_prefix = $main::cfg{'APACHE_SUEXEC_USER_PREF'}; |
|---|
| 43 |
my $master_user = $main::cfg{'APACHE_SUEXEC_MIN_UID'}; |
|---|
| 44 |
my $user_delete = $main::cfg{'CMD_USERDEL'}; |
|---|
| 45 |
my $database = $main::cfg{'DATABASE_NAME'}; |
|---|
| 46 |
|
|---|
| 47 |
## MAIN |
|---|
| 48 |
print STDOUT "Re-setting ISPCP Setup!\n"; |
|---|
| 49 |
print STDOUT "========================\n"; |
|---|
| 50 |
|
|---|
| 51 |
if ($main::cfg{'ROOT_GROUP'} eq "wheel") { |
|---|
| 52 |
$delete_cmd = "rmuser -y $user_prefix$master_user"; |
|---|
| 53 |
$rs = sys_command($delete_cmd); |
|---|
| 54 |
} else { |
|---|
| 55 |
$delete_cmd = "$user_delete -r $user_prefix$master_user"; |
|---|
| 56 |
$rs = sys_command($delete_cmd); |
|---|
| 57 |
my $delete_fcgi = "$main::cfg{'CMD_RM'} -r $main::cfg{'PHP_STARTER_DIR'}/master"; |
|---|
| 58 |
$rs = sys_command($delete_fcgi); |
|---|
| 59 |
} |
|---|
| 60 |
|
|---|
| 61 |
$sql = "DROP DATABASE IF EXISTS $database"; |
|---|
| 62 |
($rs, $rdata) = doSQL($sql); |
|---|
| 63 |
|
|---|
| 64 |
if ($rs != 0) { |
|---|
| 65 |
print STDOUT "An error occured!\n"; |
|---|
| 66 |
print STDOUT "$rdata\n"; |
|---|
| 67 |
} else { |
|---|
| 68 |
print STDOUT "done!\n"; |
|---|
| 69 |
} |
|---|