Index: trunk/cgi-bin/CustIDCK.pm
===================================================================
--- trunk/cgi-bin/CustIDCK.pm	(revision 416)
+++ trunk/cgi-bin/CustIDCK.pm	(revision 417)
@@ -34,5 +34,5 @@
 
   return 1 if $custid =~ /^STAFF$/;
-  return 1 if $custid =~ /^6750400$/;  # just in case some later change might block this
+  return 1 if $custid =~ /^5554242$/;  # just in case some later change might block this
   return 1 if $custid =~ /^\d{7}$/;
   return 1 if $custid =~ /^\d{10}$/;
Index: trunk/cgi-bin/IPDB.pm
===================================================================
--- trunk/cgi-bin/IPDB.pm	(revision 416)
+++ trunk/cgi-bin/IPDB.pm	(revision 417)
@@ -7,5 +7,5 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004-2006 - Kris Deugau
+# Copyright (C) 2004-2010 - Kris Deugau
 
 package IPDB;
@@ -20,5 +20,5 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
-$VERSION	= 2.6;
+$VERSION	= 2; ##VERSION##
 @ISA		= qw(Exporter);
 @EXPORT_OK    = qw(
@@ -53,7 +53,19 @@
 our %IPDBacl;
 
-our $orgname = 'Example Corp';
+our $org_name = 'Example Corp';
 our $smtphost = 'smtp.example.com';
 our $domain = 'example.com';
+our $defcustid = '5554242';
+# mostly for rwhois
+##fixme:  leave these blank by default?
+our $org_street = '123 4th Street';
+our $org_city = 'Anytown';
+our $org_prov_state = 'ON';
+our $org_pocode = 'H0H 0H0';
+our $org_country = 'CA';
+our $org_phone = '000-555-1234';
+our $org_techhandle = 'ISP-ARIN-HANDLE';
+
+our $syslog_facility = 'local2';
 
 # Let's initialize the globals.
@@ -561,5 +573,5 @@
     # have to insert all pool IPs into poolips table as "unallocated".
     $sth = $dbh->prepare("insert into poolips (pool,ip,custid,city,type)".
-	" values ('$pool', ?, '6750400', '$city', '$type')");
+	" values ('$pool', ?, '$defcustid', '$city', '$type')");
     my @poolip_list = $pool->hostenum;
     if ($class eq 'all') { # (DSL-ish block - *all* IPs available
@@ -618,5 +630,5 @@
     eval {
       $msg = "Unable to deallocate $disp_alloctypes{$type} $cidr";
-      $sth = $dbh->prepare("update poolips set custid='6750400',available='y',".
+      $sth = $dbh->prepare("update poolips set custid='$defcustid',available='y',".
 	"city=(select city from allocations where cidr >>= '$cidr'".
 	" order by masklen(cidr) desc limit 1),".
@@ -716,5 +728,5 @@
 ##TEMP
   # We've already deleted the block, now we have to stuff its IPs into the pool.
-  my $sth2 = $dbh->prepare("insert into poolips values ('209.91.185.0/24',?,'6750400','Sudbury','di','y','','','')");
+  my $sth2 = $dbh->prepare("insert into poolips values ('209.91.185.0/24',?,'$defcustid','Sudbury','di','y','','','')");
   $sth2->execute($cidr->addr);
   foreach my $ip ($cidr->hostenum) {
@@ -849,5 +861,5 @@
 	"Subject: {IPDB} $subj\n",
 	"X-Mailer: IPDB Notify v".sprintf("%.1d",$IPDB::VERSION)."\n",
-	"Organization: $orgname\n",
+	"Organization: $org_name\n",
 	"\n$message\n");
   }
Index: trunk/cgi-bin/MyIPDB.pm
===================================================================
--- trunk/cgi-bin/MyIPDB.pm	(revision 416)
+++ trunk/cgi-bin/MyIPDB.pm	(revision 417)
@@ -8,5 +8,8 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004-2006 - Kris Deugau
+# Copyright (C) 2004-2010 - Kris Deugau
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
 
 use IPDB 2.0 qw(:ALL);
@@ -24,4 +27,19 @@
 #$IPDB::smtphost = '127.0.0.1';
 #$IPDB::domain = 'bob.com';
+#$IPDB::defcustid = '5554242';
+# Globals for db2rwhois.pl
+#$IPDB::org_street = '123 4th Street';
+#$IPDB::org_city = 'Anytown';
+#$IPDB::org_prov_state = 'ON';
+#$IPDB::org_pocode = 'H0H 0H0';
+#$IPDB::org_country = 'CA';
+#$IPDB::org_phone = '000-555-1234';
+# note: following may also just be a bare email address
+#$IPDB::org_techhandle = 'ISP-ARIN-HANDLE';
+
+# Logging destination.  Defaults to local2.  See your local syslog docs for valid facilities.
+# Note that the value here should have the LOG_ prefix removed, and convert to lower-case.
+# local0 through local7 and user make the most sense.
+#$IPDB::syslog_facility = 'daemon';
 
 # Keep Perl from complaining.
Index: trunk/cgi-bin/access-pwd-update.pl
===================================================================
--- trunk/cgi-bin/access-pwd-update.pl	(revision 416)
+++ trunk/cgi-bin/access-pwd-update.pl	(revision 417)
@@ -8,10 +8,13 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2007,2008 - Kris Deugau
+# Copyright (C) 2007-2010 - Kris Deugau
 
 use strict;
 use warnings;
 use DBI;
-use lib '/var/www/ipdb.example.com/ip/cgi-bin/';
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
 use MyIPDB;
 
Index: trunk/cgi-bin/admin.cgi
===================================================================
--- trunk/cgi-bin/admin.cgi	(revision 416)
+++ trunk/cgi-bin/admin.cgi	(revision 417)
@@ -10,5 +10,5 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004-2006 - Kris Deugau
+# Copyright (C) 2004-2010 - Kris Deugau
 
 use strict;
@@ -17,5 +17,4 @@
 use DBI;
 use CommonWeb qw(:ALL);
-use MyIPDB;
 use CustIDCK;
 #use POSIX qw(ceil);
@@ -23,4 +22,9 @@
 
 use Sys::Syslog;
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
+use MyIPDB;
 
 openlog "IPDB-admin","pid","local2";
@@ -149,5 +153,5 @@
       if (!$status) {
 	printError("Customer ID not valid.  Make sure the Customer ID ".
-	  "is correct.<br>\nUse STAFF for staff static IPs, and 6750400 for any other ".
+	  "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
 	  "non-customer assignments.");
 	return;
Index: trunk/cgi-bin/allocate.pl
===================================================================
--- trunk/cgi-bin/allocate.pl	(revision 416)
+++ trunk/cgi-bin/allocate.pl	(revision 417)
@@ -10,14 +10,14 @@
 use strict;
 use warnings;
-#use CGI::Carp qw(fatalsToBrowser);
-use Carp;
 use DBI;
 use CommonWeb qw(:ALL);
-use MyIPDB;
-use IBLink;
-use POSIX qw(ceil);
 use NetAddr::IP;
 
 use Sys::Syslog;
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
+use MyIPDB;
 
 openlog "IPDBshell","pid","local2";
Index: trunk/cgi-bin/checkcusts.pl
===================================================================
--- trunk/cgi-bin/checkcusts.pl	(revision 416)
+++ trunk/cgi-bin/checkcusts.pl	(revision 417)
@@ -7,5 +7,5 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004-2006 Kris Deugau
+# Copyright (C) 2004-2010 Kris Deugau
 
 use DBI;
@@ -33,5 +33,5 @@
   push @def_custids, $data[0];
 }
-$sth = $dbh->prepare("select cidr,custid from searchme where not (custid='6750400') ".
+$sth = $dbh->prepare("select cidr,custid from searchme where not (custid='$IPDB::defcustid') ".
 	"and not (custid='STAFF') order by cidr");
 #$sth = $dbh->prepare("select cidr,custid from searchme order by cidr");
Index: trunk/cgi-bin/combineblocks.pl
===================================================================
--- trunk/cgi-bin/combineblocks.pl	(revision 416)
+++ trunk/cgi-bin/combineblocks.pl	(revision 417)
@@ -14,9 +14,11 @@
 use DBI;
 #use CommonWeb qw(:ALL);
-use MyIPDB;
 #use POSIX qw(ceil);
 use NetAddr::IP;
 
-#use Sys::Syslog;
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
+use MyIPDB;
 
 my $null = new NetAddr::IP "255.255.255.255/32";
Index: trunk/cgi-bin/consistency-check.pl
===================================================================
--- trunk/cgi-bin/consistency-check.pl	(revision 416)
+++ trunk/cgi-bin/consistency-check.pl	(revision 417)
@@ -8,9 +8,13 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004 - Kris Deugau
+# Copyright (C) 2004-2010 - Kris Deugau
 
 use DBI;
+use NetAddr::IP;
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
 use MyIPDB;
-use NetAddr::IP;
 
 print "Content-type: text/plain\n\n";
@@ -230,5 +234,5 @@
 print "Checking for customer blocks with 'bad' CustIDs:\n";
 # Make sure cn-type ("customer netblock") blocks have "real" CustIDs.
-$sth = $dbh->prepare("select cidr,type,custid from allocations where type='cn' and (custid='6750400' or custid='STAFF') order by cidr");
+$sth = $dbh->prepare("select cidr,type,custid from allocations where type='cn' and (custid='$IPDB::defcustid' or custid='STAFF') order by cidr");
 $sth->execute;
 while (@data = $sth->fetchrow_array) {
Index: trunk/cgi-bin/extras/db2rwhois.pl
===================================================================
--- trunk/cgi-bin/extras/db2rwhois.pl	(revision 416)
+++ trunk/cgi-bin/extras/db2rwhois.pl	(revision 417)
@@ -10,5 +10,5 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004-2007 - Kris Deugau
+# Copyright (C) 2004-2010 - Kris Deugau
 
 use strict;
@@ -16,8 +16,13 @@
 use DBI;
 use NetAddr::IP;
+use File::Path 'rmtree';
+use POSIX qw(strftime);
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
 use MyIPDB;
-use File::Path 'rmtree';
-
-$ENV{"PATH"} = "/bin;/usr/bin";
+
+#$ENV{"PATH"} = "/bin;/usr/bin";
 
 my $rwhoisDataPath = "/etc/rwhoisd";
@@ -91,6 +96,5 @@
   print "$masterblocks[$i] $ctime $mtime\n";
 
-  my $date;
-  chomp ($date = `/bin/date +"%Y-%m-%d"`);
+  my $date = strftime("%Y-%m-%d", localtime);
 
   my $rwnet = "net-".$masterblocks[$i]->addr."-".$masterblocks[$i]->masklen;
@@ -111,7 +115,7 @@
     mkdir "$netdatadir/data/referral";
 
-    my $serial;
-    chomp ($serial = `/bin/date '+%Y%m%d'000000000`);
-
+    my $serial = strftime("%Y%m%d%H%M%S000", localtime);
+
+##fixme: SOA should be different every time data changes, therefore need to rewrite this ~~ every export :(
     print "  Creating SOA...\n";
     open SOAFILE, ">$netdatadir/soa";
@@ -147,17 +151,19 @@
 
     print "  Copying template files...\n";
+##fixme: find a way to do this without a shell (or functional equivalent)
     qx { /bin/cp $rwhoisDataPath/skel/attribute_defs/* $netdatadir/attribute_defs/ };
 
+##fixme: not sure if this is even necessary, since it's not referenced anywhere I can recall...
     print "  Creating org data...\n";
-    open ORGDATAFILE, ">$netdatadir/data/org/friendlyisp.txt";
+    open ORGDATAFILE, ">$netdatadir/data/org/ourorg.txt";
     print ORGDATAFILE qq(ID: NETBLK-ISP.$masterblocks[$i]
 Auth-Area: $masterblocks[$i]
-Org-Name: Friendly ISP
-Street-Address: 123 4th Street
-City: Anytown
-State: ON
-Postal-Code: H0H 0H0
-Country-Code: CA
-Phone: 000-555-1234
+Org-Name: $IPDB::org_name
+Street-Address: $IPDB::org_street
+City: $IPDB::org_city
+State: $IPDB::org_prov_state
+Postal-Code: $IPDB::org_pocode
+Country-Code: $IPDB::org_country
+Phone: $IPDB::org_phone
 Created: 20040308
 Updated: 20040308
@@ -189,11 +195,11 @@
 	"IP-Network: $masterblocks[$i]\n".
 	"IP-Network-Block: ".$masterblocks[$i]->range."\n".
-	"Org-Name: Friendly ISP\n".
-	"Street-Address: 123 4th Street\n".
-	"City: Anytown\n".
-	"StateProv: Ontario\n".
-	"Postal-Code: H0H 0H0\n".
-	"Country-Code: CA\n".
-	"Tech-Contact: ISP-ARIN-HANDLE\n".
+	"Org-Name: $IPDB::org_name\n".
+	"Street-Address: $IPDB::org_street\n".
+	"City: $IPDB::org_city\n".
+	"StateProv: $IPDB::org_prov_state\n".
+	"Postal-Code: $IPDB::org_pocode\n".
+	"Country-Code: $IPDB::org_country\n".
+	"Tech-Contact: $IPDB::org_techhandle\n".
 	"Created: $ctime\n".
 	"Updated: $mtime\n".
@@ -226,5 +232,5 @@
 
 # Fill in a generic entry for nameless allocations
-if ($desc =~ /^\s*$/) { $desc = 'Friendly ISP'; }
+if ($desc =~ /^\s*$/) { $desc = $IPDB::org_name; }
 
     # Fix up datestamps.  We don't *really* need sub-microsecond resolution on our exports...
@@ -257,11 +263,11 @@
 	"IP-Network: $net\n".
 	"IP-Network-Block: ".$net->range."\n".
-	"Org-Name: Friendly ISP\n".
-	"Street-Address: 123 4th Street\n".
-	"City: Anytown\n".
-	"StateProv: Ontario\n".
-	"Postal-Code: H0H 0H0\n".
-	"Country-Code: CA\n".
-	"Tech-Contact: ISP-ARIN-HANDLE\n".
+	"Org-Name: $IPDB::org_name\n".
+	"Street-Address: $IPDB::org_street\n".
+	"City: $IPDB::org_city\n".
+	"StateProv: $IPDB::org_prov_state\n".
+	"Postal-Code: $IPDB::org_pocode\n".
+	"Country-Code: $IPDB::org_country\n".
+	"Tech-Contact: $IPDB::org_techhandle\n".
 	"Created: $ctime\n".
 	"Updated: $mtime\n".
@@ -281,11 +287,11 @@
 	"IP-Network: $net\n".
 	"IP-Network-Block: ".$net->range."\n".
-	"Org-Name: ".($name ? $name : 'Friendly ISP')."\n".
-	"Street-Address: ".($street ? $street : '123 4th Street')."\n".
-	"City: ".($city ? $city : 'Anytown')."\n".
-	"StateProv: ".($prov ? $prov : 'Ontario')."\n".
-	"Postal-Code: ".($pocode ? $pocode : 'H0H 0H0')."\n".
-	"Country-Code: ".($country ? $country : 'CA')."\n".
-	"Tech-Contact: ".($tech ? $tech : 'ISP-ARIN-HANDLE')."\n".
+	"Org-Name: ".($name ? $name : $IPDB::org_name)."\n".
+	"Street-Address: ".($street ? $street : $IPDB::org_street)."\n".
+	"City: ".($city ? $city : $IPDB::org_city)."\n".
+	"StateProv: ".($prov ? $prov : $IPDB::org_prov_state)."\n".
+	"Postal-Code: ".($pocode ? $pocode : $IPDB::org_pocode)."\n".
+	"Country-Code: ".($country ? $country : $IPDB::org_country)."\n".
+	"Tech-Contact: ".($tech ? $tech : $IPDB::org_techhandle)."\n".
 	"Created: $ctime\n".
 	"Updated: $mtime\n".
Index: trunk/cgi-bin/freespace.pl
===================================================================
--- trunk/cgi-bin/freespace.pl	(revision 416)
+++ trunk/cgi-bin/freespace.pl	(revision 417)
@@ -8,9 +8,13 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004-2006 - Kris Deugau
+# Copyright (C) 2004-2010 - Kris Deugau
 
 use DBI;
+use NetAddr::IP;
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
 use MyIPDB;
-use NetAddr::IP;
 
 ($dbh,$errstr) = connectDB_My;
Index: trunk/cgi-bin/ipdb.psql
===================================================================
--- trunk/cgi-bin/ipdb.psql	(revision 416)
+++ trunk/cgi-bin/ipdb.psql	(revision 417)
@@ -137,10 +137,10 @@
 mi	Static IP - Dialup	Static dialup IP	23		ISP
 wi	Static IP - Wireless	Static wireless IP	24		ISP
-sd	Static Pool - Servers	Server pool	40	6750400	ISP
+sd	Static Pool - Servers	Server pool	40	5554242	ISP
 cd	Static Pool - Cable	Cable pool	41	CBL-BUS	ISP-STATIC-CABLE
 dp	Static Pool - DSL	DSL pool	42	DSL-BUS	ISP-STATIC-DSL
 mp	Static Pool - Dialup	Static dialup pool	43	DIAL-BUS	ISP-STATIC-DIAL
 wp	Static Pool - Wireless	Static wireless pool	44	WL-BUS	ISP-STATIC-WIFI
-en	End-use netblock	End-use netblock	100	6750400	ISP
+en	End-use netblock	End-use netblock	100	5554242	ISP
 me	Dialup netblock	Dialup netblock	101	DIAL-RES	ISP-DIAL
 de	Dynamic DSL block	Dynamic DSL block	102	DSL-RES	ISP-DSL
@@ -154,15 +154,15 @@
 ad	Static Pool - Management	Management pool	196	NOC-VPN	ISP
 bd	Static pool - Wifi CPE	Wifi CPE pool	197		ISP
-in	Internal netblock	Internal netblock	199	6750400	ISP
-wc	Reserve for CORE/WAN blocks	CORE/WAN blocks	200	6750400	ISP
-pc	Reserve for dynamic-route DSL netblocks	Dynamic-route netblocks	201	6750400	ISP-STATIC-DSL
-ac	Reserve for ATM	ATM blocks	202	6750400	ISP
-fc	Reserve for fibre	Fibre blocks	203	6750400	ISP
-wr	CORE/WAN block	CORE/WAN block	220	6750400	ISP
+in	Internal netblock	Internal netblock	199	5554242	ISP
+wc	Reserve for CORE/WAN blocks	CORE/WAN blocks	200	5554242	ISP
+pc	Reserve for dynamic-route DSL netblocks	Dynamic-route netblocks	201	5554242	ISP-STATIC-DSL
+ac	Reserve for ATM	ATM blocks	202	5554242	ISP
+fc	Reserve for fibre	Fibre blocks	203	5554242	ISP
+wr	CORE/WAN block	CORE/WAN block	220	5554242	ISP
 pr	Dynamic-route DSL netblock (cust)	Dynamic-route DSL (cust)	221		ISPCUST
 ar	ATM block	ATM block	222		ISP
 fr	Fibre	Fibre	223		ISP
-rm	Routing	Routed netblock	500	6750400	ISP
-mm	Master block	Master block	999	6750400	ISP
+rm	Routing	Routed netblock	500	5554242	ISP
+mm	Master block	Master block	999	5554242	ISP
 \.
 
Index: trunk/cgi-bin/main.cgi
===================================================================
--- trunk/cgi-bin/main.cgi	(revision 416)
+++ trunk/cgi-bin/main.cgi	(revision 417)
@@ -7,4 +7,5 @@
 # Last update by $Author$
 ###
+# Copyright (C) 2004-2010 - Kris Deugau
 
 use strict;		
@@ -13,5 +14,4 @@
 use DBI;
 use CommonWeb qw(:ALL);
-use MyIPDB;
 use CustIDCK;
 use POSIX qw(ceil);
@@ -19,4 +19,9 @@
 
 use Sys::Syslog;
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
+use MyIPDB;
 
 openlog "IPDB","pid","local2";
@@ -956,5 +961,5 @@
       if (!$status) {
 	printError("Customer ID not valid.  Make sure the Customer ID ".
-	  "is correct.<br>\nUse STAFF for staff static IPs, and 6750400 for any other ".
+	  "is correct.<br>\nUse STAFF for staff static IPs, and $defcustid for any other ".
 	  "non-customer assignments.");
 	return;
Index: trunk/cgi-bin/newcity.cgi
===================================================================
--- trunk/cgi-bin/newcity.cgi	(revision 416)
+++ trunk/cgi-bin/newcity.cgi	(revision 417)
@@ -8,5 +8,5 @@
 # Last update by $Author$
 ###
-# Copyright (C) 2004,2005 - Kris Deugau
+# Copyright (C) 2004-2010 - Kris Deugau
 
 use strict;
@@ -15,9 +15,13 @@
 use DBI;
 use CommonWeb qw(:ALL);
-use MyIPDB;
 #use POSIX qw(ceil);
 use NetAddr::IP;
 
 use Sys::Syslog;
+
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
+use MyIPDB;
 
 openlog "IPDB","pid","local2";
Index: trunk/cgi-bin/newnode.cgi
===================================================================
--- trunk/cgi-bin/newnode.cgi	(revision 416)
+++ trunk/cgi-bin/newnode.cgi	(revision 417)
@@ -15,11 +15,14 @@
 use DBI;
 use CommonWeb qw(:ALL);
-use MyIPDB;
 #use POSIX qw(ceil);
 use NetAddr::IP;
-
 use Sys::Syslog;
 
-openlog "IPDB","pid","local2";
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
+use MyIPDB;
+
+openlog "IPDB","pid","$IPDB::syslog_facility";
 
 # Collect the username from HTTP auth.  If undefined, we're in a test environment.
Index: trunk/cgi-bin/search.cgi
===================================================================
--- trunk/cgi-bin/search.cgi	(revision 416)
+++ trunk/cgi-bin/search.cgi	(revision 417)
@@ -9,5 +9,5 @@
 # Last update by $Author$
 ###
-# Copyright 2005,2006 Kris Deugau
+# Copyright 2005-2010 - Kris Deugau
 
 use strict;		
@@ -16,11 +16,11 @@
 use DBI;
 use CommonWeb qw(:ALL);
-use MyIPDB;
 use POSIX qw(ceil);
 use NetAddr::IP;
 
-# Don't need a username or syslog here.  syslog left active for debugging.
-use Sys::Syslog;
-openlog "IPDBsearch","pid","local2";
+# don't remove!  required for GNU/FHS-ish install from tarball
+##uselib##
+
+use MyIPDB;
 
 # Why not a global DB handle?  (And a global statement handle, as well...)
