summaryrefslogtreecommitdiff
path: root/fs_webdemo/registerd.Pg
diff options
context:
space:
mode:
authorivan <ivan>2001-04-26 02:20:41 +0000
committerivan <ivan>2001-04-26 02:20:41 +0000
commit85c2ddbd1de869de87001bbf16b50dd63ac4b6a1 (patch)
treeed6b5051e206e4be9be341b35da8c6d755ebf824 /fs_webdemo/registerd.Pg
parentcec839776b1946de882e5bd968732ac472adbce3 (diff)
arg
Diffstat (limited to 'fs_webdemo/registerd.Pg')
-rwxr-xr-xfs_webdemo/registerd.Pg9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs_webdemo/registerd.Pg b/fs_webdemo/registerd.Pg
index 996ac8b23..7fa4c9a3d 100755
--- a/fs_webdemo/registerd.Pg
+++ b/fs_webdemo/registerd.Pg
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
-# $Id: registerd.Pg,v 1.5 2001-04-26 02:18:15 ivan Exp $
+# $Id: registerd.Pg,v 1.6 2001-04-26 02:20:41 ivan Exp $
use strict;
use vars qw(
@@ -85,14 +85,17 @@ while ( 1 ) {
my $username = $row->{'username'};
my $email = $row->{'passwd'};
- $pdbh = DBI->connect( 'DBI:Pg:host=localhost;database=demo_template', 'freeside', 'maelcolm' )
+ my $pdbh = DBI->connect( 'DBI:Pg:host=localhost;database=demo_template', 'freeside', 'maelcolm' )
or do { &myerr("$username: ". $DBI::errstr); next; };
- $psth = $pdbh->prepare("CREATE DATABASE demo_$username")
+ my $psth = $pdbh->prepare("CREATE DATABASE demo_$username")
or do { &myerr("$username: ". $pdbh->errstr;); next; };
$psth->execute()
or do { &myerr("$username: ". $psth->errstr;); next; };
+ $pdbh->disconnect
+ or do { &myerr("fatal: $DBI:errstr"); die; };
+
open(PSQL,"|psql -U freeside demo_$username")
or do { &myerr("|psql -U freeside demo_$username: $!"); next; };
open(PSQLDATA, "</usr/local/etc/freeside/demo_template.Pg")