Changeset 420 for trunk/cgi-bin


Ignore:
Timestamp:
07/04/10 16:01:22 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix dangling $defcustid -> $IPDB::defcustid
Return quietly from mailNotify if there's no recipients
Move rWHOIS data path definition/default into MyIPDB.pm/IPDB.pm respectively

Location:
trunk/cgi-bin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r417 r420  
    5959# mostly for rwhois
    6060##fixme:  leave these blank by default?
     61our $rwhoisDataPath = '/usr/local/rwhoisd/etc/rwhoisd'; # to match ./configure defaults from rwhoisd-1.5.9.6
    6162our $org_street = '123 4th Street';
    6263our $org_city = 'Anytown';
     
    853854  }
    854855
     856  return if !@reciplist;
     857
    855858  foreach my $recip (@reciplist) {
    856859    $mailer->mail("ipdb\@$domain");
  • trunk/cgi-bin/MyIPDB.pm

    r417 r420  
    2929#$IPDB::defcustid = '5554242';
    3030# Globals for db2rwhois.pl
     31#$IPDB::rwhoisDataPath = '/usr/local/rwhoisd/etc/rwhoisd';
    3132#$IPDB::org_street = '123 4th Street';
    3233#$IPDB::org_city = 'Anytown';
  • trunk/cgi-bin/extras/db2rwhois.pl

    r417 r420  
    2626#$ENV{"PATH"} = "/bin;/usr/bin";
    2727
    28 my $rwhoisDataPath = "/etc/rwhoisd";
    29 
    3028my @autharea;
    3129my $authrw;
    3230# Use the template file to allow us to keep persistent nodes aside from netblock data
    33 open AUTHTEMPLATE, "<$rwhoisDataPath/rwhoisd.auth_template";
     31open AUTHTEMPLATE, "<$IPDB::rwhoisDataPath/rwhoisd.auth_template";
    3432my $template_persist;
    3533while (<AUTHTEMPLATE>) {
     
    4846
    4947# Get the list of live directories for potential deletion
    50 opendir RWHOISROOT, $rwhoisDataPath;
     48opendir RWHOISROOT, $IPDB::rwhoisDataPath;
    5149my %rwhoisdirs;
    5250foreach (readdir RWHOISROOT) {
     
    104102
    105103# Hokay.  Gonna do checks *here* to see if we need to create new master trees
    106   my $netdatadir = "$rwhoisDataPath/$rwnet";
     104  my $netdatadir = "$IPDB::rwhoisDataPath/$rwnet";
    107105  if (! -e $netdatadir) {
    108106    print " New master $masterblocks[$i]!\n";
     
    152150    print "  Copying template files...\n";
    153151##fixme: find a way to do this without a shell (or functional equivalent)
    154     qx { /bin/cp $rwhoisDataPath/skel/attribute_defs/* $netdatadir/attribute_defs/ };
     152    qx { /bin/cp $IPDB::rwhoisDataPath/skel/attribute_defs/* $netdatadir/attribute_defs/ };
    155153
    156154##fixme: not sure if this is even necessary, since it's not referenced anywhere I can recall...
     
    188186  my $masterfilename = "$rwnet/data/network/".$masterblocks[$i]->addr."-".$masterblocks[$i]->masklen.".txt";
    189187
    190   open MASTERFILE,">$rwhoisDataPath/$masterfilename";
     188  open MASTERFILE,">$IPDB::rwhoisDataPath/$masterfilename";
    191189
    192190  print MASTERFILE "ID: NETBLK-ISP.$masterblocks[$i]\n".
     
    310308foreach my $netdir (keys %rwhoisdirs) {
    311309  print "deleting obsolete directory $netdir...\n";
    312   rmtree ( "$rwhoisDataPath/$netdir", { verbose => 1, error => \my $errlist } );
     310  rmtree ( "$IPDB::rwhoisDataPath/$netdir", { verbose => 1, error => \my $errlist } );
    313311  for my $diag (@$errlist) {
    314312    my ($file, $message) = each %$diag;
     
    323321if ($authrw) {
    324322  print "Regenerating auth_area\n";
    325   open RWHOISDAUTH, ">$rwhoisDataPath/rwhoisd.auth_area";
     323  open RWHOISDAUTH, ">$IPDB::rwhoisDataPath/rwhoisd.auth_area";
    326324  print RWHOISDAUTH "# WARNING: This file is autogenerated!  Any static nodes should\n".
    327325                "# be entered in /etc/rwhoisd/rwhoisd.auth_template\n";
     
    339337
    340338  # restart/reload rwhoisd
    341   if (-e "$rwhoisDataPath/rwhoisd.pid") {       # no pidfile, no restart.
     339  if (-e "$IPDB::rwhoisDataPath/rwhoisd.pid") { # no pidfile, no restart.
    342340    print "Restarting rwhoisd\n";
    343     open PIDFILE, "<$rwhoisDataPath/rwhoisd.pid";
     341    open PIDFILE, "<$IPDB::rwhoisDataPath/rwhoisd.pid";
    344342    my ($rwpid) = (<PIDFILE> =~ /^(\d+)/);
    345343    close PIDFILE;
  • trunk/cgi-bin/main.cgi

    r417 r420  
    961961      if (!$status) {
    962962        printError("Customer ID not valid.  Make sure the Customer ID ".
    963           "is correct.<br>\nUse STAFF for staff static IPs, and $defcustid for any other ".
     963          "is correct.<br>\nUse STAFF for staff static IPs, and $IPDB::defcustid for any other ".
    964964          "non-customer assignments.");
    965965        return;
Note: See TracChangeset for help on using the changeset viewer.