5 my $fname = shift; # Config file to read
6 my $retval = {}; # Return value: ref-to-hash holding the configuration
7 open (CONF, $fname) or return undef;
9 my $var; # Variable name
10 my $value; # Variable value
12 s/#.*//; # Strip comments
13 next if /^\s*$/; # Ignore blank lines
14 next if (!/^\s*(\w+)\s*=\s*(.*?)\s*$/);
17 $retval->{$var} = $value;
23 my $config = ReadConfigFile("/etc/koha.conf");
24 # to remove web sites:
25 system("rm -rf ".$config->{intranetdir});
26 system("\nrm -rf ".$config->{opacdir});
29 print "enter mySQL root password, please\n";
33 system("mysqladmin -f -uroot -p$response drop ".$config->{database});
34 system("mysql -uroot -p$response -Dmysql -e\"delete from user where user='".$config->{user}.'\'"');
35 system("mysql -uroot -p$response -Dmysql -e\"delete from db where user='".$config->{user}.'\'"');
37 system("mysqladmin -uroot -p$response reload");
38 system("rm -f /etc/koha-httpd.conf");
39 system("rm -f /etc/koha.conf");
40 print "EDIT httpd.conf to remove /etc/koha-httpd.conf\n";