#!/usr/bin/perl use strict; use lib '/opt/autodoc/lib'; use Autodoc; use JSON; use DBI; use warnings; my $conf = load_conf("../etc/autodoc.json"); print "!!! STOP !!!"x4 . "\n"; print "!!! STOP !!!"x4 . "\n"; print "!!! STOP !!!"x4 . "\n"; print "!!! STOP !!!"x4 . "\n"; print "Running this script on an existing setup WILL ERASE ALL YOUR DATA!!!\n\n"; print "Are you sure you want to continue? [N/y] "; my $resp = ; chomp $resp; if ( $resp !~ /^[yY]$/ ) { print "Ok, bye\n"; exit; } print "Creating database schema\n"; system(sprintf("cat %s/%s | mysql -u %s -h %s --password='%s' %s 2>/dev/null", $conf->{path}{global}, 'etc/schema.sql', $conf->{sql}{user}, $conf->{sql}{host}, $conf->{sql}{pass}, $conf->{sql}{base} )); print "All done\n";