move anything using db into the db update part
This commit is contained in:
@@ -107,6 +107,36 @@ $bool = $term->ask_yn(
|
|||||||
);
|
);
|
||||||
deploy_db() if $bool;
|
deploy_db() if $bool;
|
||||||
|
|
||||||
|
say '';
|
||||||
|
$bool = $term->ask_yn(
|
||||||
|
prompt => 'Download and update vendor MAC prefixes (OUI data)?', default => 'n',
|
||||||
|
);
|
||||||
|
deploy_oui() if $bool;
|
||||||
|
|
||||||
|
say '';
|
||||||
|
my $default_mibhome = dir($home, 'netdisco-mibs');
|
||||||
|
if (setting('mibhome') and setting('mibhome') ne $default_mibhome) {
|
||||||
|
my $mibhome = $term->get_reply(
|
||||||
|
print_me => "MIB home options:",
|
||||||
|
prompt => "Download and update MIB files to...?",
|
||||||
|
choices => [setting('mibhome'), $default_mibhome, 'Skip this.'],
|
||||||
|
default => 'Skip this.',
|
||||||
|
);
|
||||||
|
deploy_mibs($mibhome) if $mibhome and $mibhome ne 'Skip this.';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$bool = $term->ask_yn(
|
||||||
|
prompt => "Download and update MIB files?", default => 'n',
|
||||||
|
);
|
||||||
|
deploy_mibs($default_mibhome) if $bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub deploy_db {
|
||||||
|
system 'netdisco-db-deploy';
|
||||||
|
print color 'bold blue';
|
||||||
|
say 'DB schema update complete.';
|
||||||
|
print color 'reset';
|
||||||
|
|
||||||
if (not setting('safe_password_store')) {
|
if (not setting('safe_password_store')) {
|
||||||
say '';
|
say '';
|
||||||
print color 'bold red';
|
print color 'bold red';
|
||||||
@@ -155,36 +185,6 @@ schema('netdisco')->resultset('Session')->find_or_create(
|
|||||||
{id => 'dancer_session_cookie_key', a_session => \'md5(random()::text)'},
|
{id => 'dancer_session_cookie_key', a_session => \'md5(random()::text)'},
|
||||||
{key => 'primary'},
|
{key => 'primary'},
|
||||||
);
|
);
|
||||||
|
|
||||||
say '';
|
|
||||||
$bool = $term->ask_yn(
|
|
||||||
prompt => 'Download and update vendor MAC prefixes (OUI data)?', default => 'n',
|
|
||||||
);
|
|
||||||
deploy_oui() if $bool;
|
|
||||||
|
|
||||||
say '';
|
|
||||||
my $default_mibhome = dir($home, 'netdisco-mibs');
|
|
||||||
if (setting('mibhome') and setting('mibhome') ne $default_mibhome) {
|
|
||||||
my $mibhome = $term->get_reply(
|
|
||||||
print_me => "MIB home options:",
|
|
||||||
prompt => "Download and update MIB files to...?",
|
|
||||||
choices => [setting('mibhome'), $default_mibhome, 'Skip this.'],
|
|
||||||
default => 'Skip this.',
|
|
||||||
);
|
|
||||||
deploy_mibs($mibhome) if $mibhome and $mibhome ne 'Skip this.';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$bool = $term->ask_yn(
|
|
||||||
prompt => "Download and update MIB files?", default => 'n',
|
|
||||||
);
|
|
||||||
deploy_mibs($default_mibhome) if $bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub deploy_db {
|
|
||||||
system 'netdisco-db-deploy';
|
|
||||||
print color 'bold blue';
|
|
||||||
say 'DB schema update complete.';
|
|
||||||
print color 'reset';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub deploy_oui {
|
sub deploy_oui {
|
||||||
|
|||||||
Reference in New Issue
Block a user