|
@@ -1,7 +1,8 @@
|
|
|
#!/usr/bin/perl
|
|
|
-# config script by lighta
|
|
|
-#TODO list :
|
|
|
-#- don't always override import/file, sed grep ?
|
|
|
+# rAthena Configuration Script
|
|
|
+# by lighta
|
|
|
+# TODO:
|
|
|
+# - Don't always override import/file, sed grep ?
|
|
|
|
|
|
use File::Basename;
|
|
|
use DBI;
|
|
@@ -36,7 +37,7 @@ use constant {
|
|
|
MIN_PORT => 2000, #below are usually reserved for system
|
|
|
MAX_PORT => 65535,
|
|
|
};
|
|
|
-# setup my defaults option
|
|
|
+# setup default options
|
|
|
my $sDsdFile = DESD_CONF_FILE;
|
|
|
my $sAutoyes = 0;
|
|
|
my $sForce = 0;
|
|
@@ -52,32 +53,31 @@ sub GetArgs {
|
|
|
'f=s' => \$sDsdFile, #give desired conf file
|
|
|
'auto=i' => \$sAutoyes, #Force (auto-yes)
|
|
|
'C=i' => \$sClean, #Clean (like force but remove before adding)
|
|
|
- 'target=s' => \$sTarget, #Target (wich setup to run)
|
|
|
+ 'target=s' => \$sTarget, #Target (which setup to run)
|
|
|
'Force=i' => \$sForce, #Force (bypass verification)
|
|
|
- 'OS=s' => \$sOS, #OS (specify the os you wish to use)
|
|
|
+ 'OS=s' => \$sOS, #OS (specify the OS you wish to use)
|
|
|
'help!' => \$sHelp,
|
|
|
) or $sHelp=1; #display help if invalid option
|
|
|
my $sValidTarget = "All|Conf|DB|Inst|Dump";
|
|
|
|
|
|
|
|
|
if( $sHelp ) {
|
|
|
- print "Incorect option specified, available option are:\n"
|
|
|
+ print "Incorrect option specified. Available options are:\n"
|
|
|
."\t --f filename => file (specify desiredconf to use)\n"
|
|
|
- ."\t --auto => auto-yes to question ? \n"
|
|
|
+ ."\t --auto => auto-yes to question? \n"
|
|
|
."\t --C => Clean (remove file, db, user before adding new)\n"
|
|
|
- ."\t --target => target (specify wich setup to run [$sValidTarget])\n"
|
|
|
+ ."\t --target => target (specify which setup to run [$sValidTarget])\n"
|
|
|
."\t --Force => Force (bypass verification)\n"
|
|
|
- ."\t --OS => (specify the os you wish to use and avoid check)";
|
|
|
+ ."\t --OS => (specify the OS you wish to use and avoid check)";
|
|
|
exit;
|
|
|
}
|
|
|
unless($sTarget =~ /$sValidTarget/i){
|
|
|
- print "Incorect target specified, available target are:\n"
|
|
|
- ."\t --target => target (specify wich setup to run [(default)$sValidTarget])\n";
|
|
|
+ print "Incorrect target specified. Available targets are:\n"
|
|
|
+ ."\t --target => target (specify which setup to run [(default)$sValidTarget])\n";
|
|
|
exit;
|
|
|
}
|
|
|
if($sDsdFile ne DESD_CONF_FILE && !(-e -r $sDsdFile)){
|
|
|
- print "Incorect file specified: '$sDsdFile'\n"
|
|
|
- ."\t this file doesn't seem to appear on filesystem or unable to read\n";
|
|
|
+ print "File '$sDsdFile' could not be read or does not exist.\n";
|
|
|
exit;
|
|
|
}
|
|
|
}
|
|
@@ -85,7 +85,7 @@ sub GetArgs {
|
|
|
sub Main {
|
|
|
my($filename, $dir, $suffix) = fileparse($0);
|
|
|
chdir $dir; #put ourself like was called in tools
|
|
|
- print "Welcome to athena config-tool\n";
|
|
|
+ print "Running rAthena's configuration tool...\n";
|
|
|
#default conf
|
|
|
my %hDefConf = ( SERV_UID => "s1",
|
|
|
SERV_PW => "p1",
|
|
@@ -107,13 +107,13 @@ sub Main {
|
|
|
if($sTarget =~ /All|Conf/i) { ConfigConf(\%hDefConf); chdir "$sBasedir"; }
|
|
|
if($sTarget =~ /All|DB/i) { ConfigDB(\%hDefConf); chdir "$sBasedir"; }
|
|
|
if($sTarget =~ /All|Dump/i) { chdir "~"; EnableCoredump(); }
|
|
|
- print "Config done, you should be able to launch and connect server now\n";
|
|
|
- print "NB : Don't forget to update your client clieninfo.xml to match change\n";
|
|
|
+ print "Setup successful. You can now launch and connect to the servers.\n";
|
|
|
+ print "(Remember to update the client's 'clientinfo.xml' to match your changes.)\n";
|
|
|
}
|
|
|
|
|
|
|
|
|
sub EnableCoredump {
|
|
|
- print "\n Starting Enabling coredump \n";
|
|
|
+ print "\n== Enabling Coredumps ==\n";
|
|
|
my $sCurfile = "~/.bashrc";
|
|
|
my @lines = ();
|
|
|
my $sJump = .0;
|
|
@@ -126,9 +126,9 @@ sub EnableCoredump {
|
|
|
push(@lines,$_) if /ulimit/;
|
|
|
}
|
|
|
if(scalar(@lines)>0){
|
|
|
- print "ulimit instruction found in file=$sCurfile\n"
|
|
|
+ print "ulimit instruction found in file '$sCurfile'.\n"
|
|
|
."\t lines= \n @lines \n"
|
|
|
- ."are you sure you want to continue ? [y/n] \n";
|
|
|
+ ."Are you sure you want to continue? [y/n] \n";
|
|
|
$sJump=1 if(GetValidAnwser("y|o|n",$sAutoyes) =~ /n/i);
|
|
|
}
|
|
|
system("sudo echo \"ulimit -c unlimited\" >> $sCurfile") if $sJump==0;
|
|
@@ -149,7 +149,7 @@ sub EnableCoredump {
|
|
|
}
|
|
|
close FILE;
|
|
|
close FILE_TMP;
|
|
|
- system("sudo mv tmp_limits.conf /etc/security/limits.conf") if $sJump==1; #don't overwritte if some config was already in there
|
|
|
+ system("sudo mv tmp_limits.conf /etc/security/limits.conf") if $sJump==1; #don't overwrite if some config was already in there
|
|
|
unlink "tmp_limits.conf";
|
|
|
}
|
|
|
|
|
@@ -160,9 +160,9 @@ sub EnableCoredump {
|
|
|
push(@lines,$_) if /^kernel.core/;
|
|
|
}
|
|
|
if(scalar(@lines)>0){
|
|
|
- print "ulimit instruction found in file=$sCurfile\n"
|
|
|
+ print "ulimit instruction found in file '$sCurfile'.\n"
|
|
|
."\t line= \n @lines \n"
|
|
|
- ."are you sure you want to continue ? [y/n] \n";
|
|
|
+ ."Are you sure you want to continue? [y/n] \n";
|
|
|
$sJump=2 if(GetValidAnwser("y|o|n",$sAutoyes) =~ /n/i);
|
|
|
}
|
|
|
unless($sJump==2){
|
|
@@ -187,7 +187,7 @@ sub GetOS {
|
|
|
my @aSupportedOS = ("Debian","Ubuntu","Fedora","CentOs","FreeBSD");
|
|
|
my $sOSregex = join("|",@aSupportedOS);
|
|
|
until($sOS =~ /$sOSregex/i){
|
|
|
- print "Please enter your OS:[$sOSregex] or enter 'quit' to exit\n";
|
|
|
+ print "Please enter your OS [$sOSregex] or enter 'quit' to exit.\n";
|
|
|
$sOS = <>; chomp($sOS);
|
|
|
last if($sOS eq "quit");
|
|
|
}
|
|
@@ -196,10 +196,10 @@ sub GetOS {
|
|
|
}
|
|
|
|
|
|
sub InstallSoft {
|
|
|
- print "\n Starting InstallSoft \n";
|
|
|
- print "This autoinstall feature is experimental, package name varies from distri and version, couldn't support them all\n";
|
|
|
+ print "\n== Installing Software ==\n";
|
|
|
+ print "NOTE: This auto-install feature is experimental. Package names vary in different distributions and versions, so they may be incorrect.\n";
|
|
|
$sOS = GetOS() unless $sOS;
|
|
|
- if($sOS eq "quit"){ print "Skipping Software installation\n"; return; }
|
|
|
+ if($sOS eq "quit"){ print "Skipping software installation...\n"; return; }
|
|
|
elsif($sOS =~ /Ubuntu|Debian/i) { #tested on ubuntu 12.10,13.10
|
|
|
my @aListSoft = ("gcc","gdb","zlibc","zlib1g-dev","make","git","mysql-client","mysql-server","mysql-common","libmysqlclient-dev","phpmyadmin","libpcre3-dev");
|
|
|
print "Going to install: @aListSoft\n";
|
|
@@ -225,11 +225,11 @@ sub InstallSoft {
|
|
|
}
|
|
|
|
|
|
sub ConfigConf { my ($rhDefConf) = @_;
|
|
|
- print "\n Starting ConfigConf \n";
|
|
|
+ print "\n== Setting Configurations ==\n";
|
|
|
my $rhUserConf;
|
|
|
while(1) {
|
|
|
$rhUserConf = GetDesiredConf($rhDefConf);
|
|
|
- print "SetupConf using conf : \n";
|
|
|
+ print "SetupConf using conf: \n";
|
|
|
ShowConfig($rhUserConf);
|
|
|
last if($sForce || AutoCheckConf($rhUserConf));
|
|
|
}
|
|
@@ -237,11 +237,11 @@ sub ConfigConf { my ($rhDefConf) = @_;
|
|
|
}
|
|
|
|
|
|
sub ConfigDB { my ($rhDefConf) = @_;
|
|
|
- print "\n Starting ConfigDB \n";
|
|
|
+ print "\n== Setting Up Databases ==\n";
|
|
|
my $rhUserConf;
|
|
|
while(1) {
|
|
|
$rhUserConf = GetDesiredConf($rhDefConf);
|
|
|
- print "SetupDb using conf : \n";
|
|
|
+ print "SetupDb using conf: \n";
|
|
|
ShowConfig($rhUserConf);
|
|
|
last if($sForce || AutoCheckConf($rhUserConf));
|
|
|
}
|
|
@@ -250,18 +250,18 @@ sub ConfigDB { my ($rhDefConf) = @_;
|
|
|
|
|
|
#conf function
|
|
|
sub ApplySetupConf { my ($rhConfig) = @_;
|
|
|
- print "\nApplying conf \n";
|
|
|
+ print "\nApplying configurations...\n";
|
|
|
my @aTargetfile = (MAP_CONF_FILE,CHAR_CONF_FILE,LOGIN_CONF_FILE,INTER_CONF_FILE);
|
|
|
my $sConfDir = "conf";
|
|
|
my $sUserConfDir = "import";
|
|
|
|
|
|
- die "$sConfDir doesn't seem to exist or coudldn't be read/writte" unless(-d -r -w "../$sConfDir");
|
|
|
+ die "'$sConfDir' doesn't seem to exist or couldn't be read/written" unless(-d -r -w "../$sConfDir");
|
|
|
chdir "../$sConfDir";
|
|
|
- print "Saving tmp user-conf \n";
|
|
|
+ print "Saving tmp user-conf.\n";
|
|
|
YAML::XS::DumpFile(DESD_CONF_FILE,$rhConfig);
|
|
|
unless(-d "$sUserConfDir") {
|
|
|
- print "conf/import directory doesn't exist, create it ? [y/n] (will be generated by compilation otherwise) \n";
|
|
|
- if(GetValidAnwser("y|o|n",$sAutoyes) =~ /n/i) { die "Couldn't apply conf without import folder\n"; }
|
|
|
+ print "Directory 'conf/import' doesn't exist. Create it? [y/n] (will be generated by compilation otherwise) \n";
|
|
|
+ if(GetValidAnwser("y|o|n",$sAutoyes) =~ /n/i) { die "Cannot apply configurations without 'import' folder, exiting...\n"; }
|
|
|
mkdir "$sUserConfDir";
|
|
|
}
|
|
|
chdir $sUserConfDir;
|
|
@@ -270,21 +270,20 @@ sub ApplySetupConf { my ($rhConfig) = @_;
|
|
|
opendir(DIR, ".") or die $!;
|
|
|
my @aDirfile = grep { /\.txt/ && -f "$_" } readdir(DIR);
|
|
|
close DIR;
|
|
|
- print "Current file in directory = [@aDirfile] target = [@aTargetfile] \n";
|
|
|
+ print "Current file in directory '@aDirfile' is target '@aTargetfile'.\n";
|
|
|
|
|
|
foreach my $sCurfile(@aTargetfile) {
|
|
|
- print "Checking if target file: [$sCurfile] exist ? ";
|
|
|
+ print "Checking if target file '$sCurfile' exists... ";
|
|
|
if(-e -r $sCurfile) {
|
|
|
- print "Yes\n";
|
|
|
- print "$sCurfile seem to exist, overwritte it [y/n] ?\n";
|
|
|
+ print "Yes. Overwrite it? [y/n] \n";
|
|
|
if(GetValidAnwser("y|o|n",$sAutoyes) =~ /n/i) {
|
|
|
- print "Only overwritte option supported atm skip file\n\n";
|
|
|
+ print "Only overwrite option currently supported. File skipped...\n\n";
|
|
|
next;
|
|
|
}
|
|
|
}
|
|
|
- else { print "No\n" };
|
|
|
+ else { print "No.\n" };
|
|
|
|
|
|
- print "\t Writting file $sCurfile \n";
|
|
|
+ print "\t Writing file '$sCurfile'...\n";
|
|
|
if($sCurfile eq MAP_CONF_FILE) { ApplyMapConf($rhConfig,$sCurfile); }
|
|
|
elsif($sCurfile eq CHAR_CONF_FILE) { ApplyCharConf($rhConfig,$sCurfile); }
|
|
|
elsif($sCurfile eq LOGIN_CONF_FILE) { ApplyLoginConf($rhConfig,$sCurfile); }
|
|
@@ -293,7 +292,7 @@ sub ApplySetupConf { my ($rhConfig) = @_;
|
|
|
}
|
|
|
|
|
|
sub ApplyMapConf { my ($rhUserConf,$sCurfile) = @_;
|
|
|
- open FILE, "> $sCurfile" || die "couldn't openfile/create $sCurfile \n";
|
|
|
+ open FILE, "> $sCurfile" || die "Couldn't open or create file '$sCurfile'.\n";
|
|
|
print FILE "userid: " . $$rhUserConf{SERV_UID}."\n";
|
|
|
print FILE "passwd: " . $$rhUserConf{SERV_PW}."\n\n";
|
|
|
|
|
@@ -303,7 +302,7 @@ sub ApplyMapConf { my ($rhUserConf,$sCurfile) = @_;
|
|
|
}
|
|
|
|
|
|
sub ApplyCharConf { my ($rhUserConf,$sCurfile) = @_;
|
|
|
- open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
|
|
|
+ open FILE, "> $sCurfile" || die "Couldn't open file '$sCurfile'.\n";
|
|
|
print FILE "userid: " . $$rhUserConf{SERV_UID}."\n";
|
|
|
print FILE "passwd: " . $$rhUserConf{SERV_PW}."\n\n";
|
|
|
|
|
@@ -313,13 +312,13 @@ sub ApplyCharConf { my ($rhUserConf,$sCurfile) = @_;
|
|
|
}
|
|
|
|
|
|
sub ApplyLoginConf { my ($rhUserConf,$sCurfile) = @_;
|
|
|
- open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
|
|
|
+ open FILE, "> $sCurfile" || die "Couldn't open file '$sCurfile'.\n";
|
|
|
print FILE "login_port: " . $$rhUserConf{LOGIN_PORT}."\n";
|
|
|
print FILE "use_MD5_passwords: " . $$rhUserConf{MD5_ENABLE}."\n";
|
|
|
}
|
|
|
|
|
|
sub ApplyInterConf { my ($rhUserConf,$sCurfile) = @_;
|
|
|
- open FILE, "> $sCurfile" || die "couldn't openfile $sCurfile \n";
|
|
|
+ open FILE, "> $sCurfile" || die "Couldn't open file '$sCurfile'.\n";
|
|
|
|
|
|
print FILE "sql.db_hostname: " . $$rhUserConf{SQL_HOST}."\n";
|
|
|
print FILE "sql.db_port: " . $$rhUserConf{SQL_PORT}."\n";
|
|
@@ -348,20 +347,21 @@ sub ApplyInterConf { my ($rhUserConf,$sCurfile) = @_;
|
|
|
}
|
|
|
|
|
|
sub AutoCheckConf { my ($rhConfig) = @_;
|
|
|
- print "\n AutoCheckConf, \n you can use option --force=1 to bypass this \n";
|
|
|
+ print "\n== Auto-Check Configuration ==\n";
|
|
|
+ print "NOTE: You can use option --force=1 to bypass this.\n";
|
|
|
foreach my $sKeys (keys %$rhConfig){
|
|
|
my $sVal = $$rhConfig{$sKeys};
|
|
|
if($sKeys =~ /PORT/) { #chek if valid port
|
|
|
if(($sVal<MIN_PORT) && ($sVal>MAX_PORT)) {
|
|
|
- warn "Invalid port specified for $sKeys => $sVal, must be in [".MIN_PORT.":".MAX_PORT."]\n";
|
|
|
+ warn "Invalid port specified for $sKeys => $sVal. Port must be in [".MIN_PORT.":".MAX_PORT."].\n";
|
|
|
return 0;
|
|
|
}
|
|
|
elsif(!($sKeys =~ /SQL/) && CheckUsedPort($sVal)) { #skip SQL service
|
|
|
- warn "Port:$sVal seem to be already in use by system \n";
|
|
|
+ warn "Port '$sVal' seems to already be in use by your system.\n";
|
|
|
return 0;
|
|
|
}
|
|
|
elsif(CheckDupPort($rhConfig,$sKeys)) {
|
|
|
- warn "Port:$sVal seem to be already used by other key in config \n";
|
|
|
+ warn "Port '$sVal' seems to already be used by another key in config.\n";
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
@@ -370,7 +370,8 @@ sub AutoCheckConf { my ($rhConfig) = @_;
|
|
|
my $sTest = $p->ping($sVal);
|
|
|
$p->close();
|
|
|
unless($sTest) {
|
|
|
- print "Invalide IP/Host, ping couldn't reach $sKeys => $sVal \n NB : ICMP may just be unallowed\n";
|
|
|
+ print "Invalid IP/Host, ping couldn't reach $sKeys => $sVal.\n";
|
|
|
+ print "(NOTE: ICMP may just be unallowed.)\n";
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
@@ -403,13 +404,13 @@ sub ApplySetupDB { my($rhConfig) = @_;
|
|
|
$sDbH = CreateUser($sDbH,$rhConfig); #loged as user now
|
|
|
LoadSqlFile($sDbH,$rhConfig); #Load .sql file into db
|
|
|
CreateServUser($sDbH,$rhConfig);
|
|
|
- print "SetupDb done \n";
|
|
|
+ print "Database setup successful.\n";
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sub CreateDB { my($sDbH,$rhConfig) = @_;
|
|
|
- print "\n Entering CreateDB \n";
|
|
|
+ print "\n== Creating Databases ==\n";
|
|
|
my $sDBn = $$rhConfig{SQL_MAIN_DB};
|
|
|
my $sLogDBn = $$rhConfig{SQL_LOG_DB};
|
|
|
my @aQuery = ("create database IF NOT EXISTS $sDBn;","create database IF NOT EXISTS $sLogDBn;");
|
|
@@ -428,16 +429,16 @@ sub CreateDB { my($sDbH,$rhConfig) = @_;
|
|
|
}
|
|
|
|
|
|
sub ValidateDBMerge { my($sDBn) = @_;
|
|
|
- warn "Database: '$sDBn' seem to already exist exiting\n";
|
|
|
- warn "Continue will load data in existing db would you like to continue ? [y/n] \n";
|
|
|
+ warn "Database '$sDBn' seems to already exist.\n";
|
|
|
+ warn "Do you wish to continue loading data from the existing database? [y/n] \n";
|
|
|
if(GetValidAnwser("y|o|n",$sAutoyes) =~ /n/i) {
|
|
|
- print "Exiting setup, please either setup with another dbname or manually\n";
|
|
|
+ print "Exiting setup, please try again with another dbname or manually...\n";
|
|
|
exit;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
sub CreateUser { my($sDbH,$rhConfig) = @_;
|
|
|
- print "\n Entering CreateUser \n";
|
|
|
+ print "\n== Creating User ==\n";
|
|
|
my $sDsn = $$rhConfig{"Dsn"};
|
|
|
print "My dsn = $sDsn \n";
|
|
|
my $sHost = $$rhConfig{SQL_HOST};
|
|
@@ -451,12 +452,12 @@ sub CreateUser { my($sDbH,$rhConfig) = @_;
|
|
|
my $sUserDbh = DBI->connect($sDsn, $sUser, $sPw, {"PrintError" => 0}); #try connect with user
|
|
|
|
|
|
if($sUserDbh && !$sClean) {
|
|
|
- print "User : $sUser seem to already exist, skipping creation\n"
|
|
|
- ."NB please check if you have correct privilege set for db: $sDBn \n";
|
|
|
+ print "User '$sUser' seems to already exist, skipping creation...\n"
|
|
|
+ ."(Please check if you have correct privileges set for database '$sDBn'.)\n";
|
|
|
}
|
|
|
else { #create user only if not exist (or mode clean)
|
|
|
if($sClean && $sUser ne "root"){ unshift(@aQuery,"DELETE FROM mysql.user WHERE User = '$sUser';"); }
|
|
|
- print "Creating user $sUser for dbs : $sDBn and $sLogDBn on $sHost \n";
|
|
|
+ print "Creating user $sUser for databases '$sDBn' and '$sLogDBn' on '$sHost'.\n";
|
|
|
ExeQuery($sDbH,@aQuery);
|
|
|
$sUserDbh = DBI->connect($sDsn, $sUser, $sPw);
|
|
|
}
|
|
@@ -464,7 +465,7 @@ sub CreateUser { my($sDbH,$rhConfig) = @_;
|
|
|
}
|
|
|
|
|
|
sub LoadSqlFile { my($sDbH,$rhConfig) = @_;
|
|
|
- print "\n Entering LoadSqlFile \n";
|
|
|
+ print "\n== Loading SQL Files ==\n";
|
|
|
my $sDBn = $$rhConfig{SQL_MAIN_DB};
|
|
|
my $sLogDBn = $$rhConfig{SQL_LOG_DB};
|
|
|
|
|
@@ -472,9 +473,9 @@ sub LoadSqlFile { my($sDbH,$rhConfig) = @_;
|
|
|
my @aMainFiles = ("main.sql"); #add other file to load for main db here
|
|
|
my @aLogFiles = ("logs.sql"); #add other file to load for log db here
|
|
|
|
|
|
- die "$sSqldir doesn't seem to exist or coudldn't be read" unless(-d -r "../$sSqldir");
|
|
|
+ die "$sSqldir doesn't seem to exist or couldn't be read." unless(-d -r "../$sSqldir");
|
|
|
chdir "../$sSqldir";
|
|
|
- print "Checking if target files exist :\n\tMain: [@aMainFiles]\n\tLog: [@aLogFiles]\n";
|
|
|
+ print "Checking if target files exist:\n\tMain: [@aMainFiles]\n\tLog: [@aLogFiles]\n";
|
|
|
|
|
|
CheckAndLoadSQL(\@aMainFiles,$rhConfig,$sDBn);
|
|
|
CheckAndLoadSQL(\@aLogFiles,$rhConfig,$sLogDBn);
|
|
@@ -490,7 +491,7 @@ sub LoadSqlFile { my($sDbH,$rhConfig) = @_;
|
|
|
# my @aQuery = ();
|
|
|
# foreach(@$raFiles) {
|
|
|
# unless(-f -r $_){
|
|
|
-# print "File : $_ doesn't seem to exist or was unreadable skipped\n";
|
|
|
+# print "File '$_' doesn't seem to exist or was unreadable, skipped...\n";
|
|
|
# next;
|
|
|
# }
|
|
|
# my $sFileFullPath = Cwd::abs_path($_);
|
|
@@ -514,34 +515,32 @@ sub CreateServUser { my($sDbH,$rhConfig) = @_;
|
|
|
}
|
|
|
|
|
|
sub GetDesiredConf { my ($rhDefConf) = @_;
|
|
|
- print "Please enter desired confiration\n";
|
|
|
+ print "Please enter desired configuration.\n";
|
|
|
my $rhUserConf;
|
|
|
my $sDesdConfFile = $sDsdFile;
|
|
|
#if default search in conf otherwise get specified name with cwd
|
|
|
if($sDsdFile eq DESD_CONF_FILE) { $sDesdConfFile = "../conf/".$sDsdFile; }
|
|
|
|
|
|
- print "Checking if there an Desiredconf file \n";
|
|
|
+ print "Checking if there is a DesiredConf file...\n";
|
|
|
if(-e -r $sDesdConfFile) {
|
|
|
- print "Found Desiredconf \n";
|
|
|
+ print "Found DesiredConf.\n";
|
|
|
$rhUserConf = YAML::XS::LoadFile($sDesdConfFile);
|
|
|
if(!($rhUserConf)){
|
|
|
- print "Desiredconf seem invalid or empty, please check file and relaunch setup or entry Config\n";
|
|
|
+ print "DesiredConf is invalid or empty. Please check the file, and relaunch setup or enter Config.\n";
|
|
|
$rhUserConf=GetValidateConf($rhDefConf);
|
|
|
}
|
|
|
else {
|
|
|
ShowConfig($rhUserConf);
|
|
|
- print "Would you like to apply those setting ? [y/n] ";
|
|
|
+ print "Would you like to apply these settings? [y/n] ";
|
|
|
if(GetValidAnwser("y|o|n",$sAutoyes) =~ /n/i) { #no take user entry
|
|
|
- print "DesiredConf not applyed, please enter config\n";
|
|
|
+ print "DesiredConf not applied. Please enter config.\n";
|
|
|
$rhUserConf=GetValidateConf($rhDefConf);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else { #no files take user entry
|
|
|
- print "No Desiredconf found, please enter config \n";
|
|
|
+ print "No DesiredConf found. Please enter config.\n";
|
|
|
$rhUserConf=GetValidateConf($rhDefConf);
|
|
|
}
|
|
|
return $rhUserConf;
|
|
|
}
|
|
|
-
|
|
|
-
|