| 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 | |
|---|
| 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) = (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 | my $delete_cmd = "$user_delete -r $user_prefix$master_user"; |
|---|
| 51 | $rs = sys_command($delete_cmd); |
|---|
| 52 | |
|---|
| 53 | my $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); |
|---|
| 58 | if ($rs != 0) { |
|---|
| 59 | print STDOUT "An error occured!\n"; |
|---|
| 60 | print STDOUT "$rdata\n"; |
|---|
| 61 | } |
|---|
| 62 | else { |
|---|
| 63 | print STDOUT "done!\n"; |
|---|
| 64 | } |
|---|