forked from elliotchance/mbzdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.pl
executable file
·62 lines (57 loc) · 1.4 KB
/
init.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
55
56
57
58
59
60
61
62
#!/usr/bin/perl
require "settings.pl";
require "languages/$g_language.pl";
require "backend/$g_db_rdbms.pl";
require "src/functions.pl";
# first boot
mbz_choose_language() if(!$g_chosenlanguage);
mbz_first_boot() if($g_firstboot);
grabaction:
print $L{'init_action'};
chomp(my $action = <STDIN>);
if($action !~ /^-?\d/ or $action < 0 or $action > 6) {
print "Invalid\n\n";
goto grabaction;
}
# don't go crazy just yet
# first give more information about the action
if($action == 1) {
print $L{'init_actionfull'};
} elsif($action == 2) {
print $L{'init_actionschema'};
} elsif($action == 3) {
print $L{'init_actionraw1'};
} elsif($action == 4) {
print $L{'init_actionraw2'};
} elsif($action == 5) {
print $L{'init_actionindex'};
} elsif($action == 6) {
print $L{'init_actionplugininit'};
}
chomp(my $input = <STDIN>);
exit(0) if($input ne "y" and $input ne "yes");
# OK, now it can have its fun
if($action == 1) {
mbz_create_extra_tables();
mbz_update_schema();
mbz_raw_download();
mbz_unzip_mbdumps();
mbz_load_data();
mbz_update_index();
mbz_init_plugins();
print "\n\n===== ALL DONE =====\n\n";
} elsif($action == 2) {
mbz_create_extra_tables();
mbz_update_schema();
} elsif($action == 3) {
mbz_raw_download();
mbz_unzip_mbdumps();
mbz_load_data();
} elsif($action == 4) {
mbz_unzip_mbdumps();
mbz_load_data();
} elsif($action == 5) {
mbz_update_index();
} elsif($action == 6) {
mbz_init_plugins();
}