#!/usr/local/bin/perl
# setup.cgi
# Setup the database server for the first time

require './postgresql-lib.pl';
&error_setup($text{'setup_err'});
$access{'stop'} || &error($text{'setup_ecannot'});
$temp = &tempname();
$rv = &system_logged("($config{'setup_cmd'}) >$temp 2>&1");
$out = `cat $temp`;
unlink($temp);
if ($rv) {
	&error("<pre>$out</pre>");
	}
sleep(3);
&webmin_log("setup");
&redirect("");

