Firstrun fix
This commit is contained in:
parent
6ad0cdda31
commit
0c984eec91
@ -71,7 +71,12 @@ sub create_base {
|
|||||||
my $gpg = $self->{_gpg};
|
my $gpg = $self->{_gpg};
|
||||||
|
|
||||||
# Check dir
|
# Check dir
|
||||||
if ( !( -d $pm_dir ) ) {
|
if ( !( -d $pm_dir ) or !( -e $pm_dir . "db.sqlite" ) ) {
|
||||||
|
|
||||||
|
# Remove old configuration dirrectory
|
||||||
|
print "Remove old dirrectory...\n";
|
||||||
|
my @rm_old_cmd = ( 'rm', '-rf', $pm_dir );
|
||||||
|
system(@rm_old_cmd) == 0 or die "Cannot remove $pm_dir: $!\n";
|
||||||
|
|
||||||
# Create dirrectory
|
# Create dirrectory
|
||||||
print "Creating configuration dirrectory...\n";
|
print "Creating configuration dirrectory...\n";
|
||||||
@ -87,6 +92,7 @@ sub create_base {
|
|||||||
system(@createdb_cmd) == 0 or die "Cannot create database file: $!\n";
|
system(@createdb_cmd) == 0 or die "Cannot create database file: $!\n";
|
||||||
|
|
||||||
print "Creating database...\n";
|
print "Creating database...\n";
|
||||||
|
|
||||||
# Create table.
|
# Create table.
|
||||||
my $dbh = DBI->connect( "dbi:SQLite:dbname=$first_sqlite", "", "" );
|
my $dbh = DBI->connect( "dbi:SQLite:dbname=$first_sqlite", "", "" );
|
||||||
print "Create database schema\n";
|
print "Create database schema\n";
|
||||||
@ -96,6 +102,7 @@ sub create_base {
|
|||||||
$dbh->do($q_table);
|
$dbh->do($q_table);
|
||||||
|
|
||||||
print "Encrypt database...\n";
|
print "Encrypt database...\n";
|
||||||
|
|
||||||
# Encrypt db
|
# Encrypt db
|
||||||
$gpg->encrypt_db($first_sqlite);
|
$gpg->encrypt_db($first_sqlite);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user