Changeset 1682 in genapp for sbin/setconfig.pl


Ignore:
Timestamp:
Mar 20, 2019, 8:03:18 AM (3 years ago)
Author:
ehb
Message:

Fixes for 18.04 & setconfig issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbin/setconfig.pl

    r1598 r1682  
    4141 -pj                           print resulting config.json
    4242 -https                        use https and wss
     43 -publicport                   specify a public port (used for websockets)
    4344 -webroot webroot              specify the webroot directory
    4445 -mongossl hostname cafile     specify the hostname and certificate file for mongod
     
    8081        die "$0: option $option requries an argument\n" . $notes if !@ARGV;
    8182        $webroot = shift @ARGV;;
     83        next;
     84    }
     85    if ( $option =~ /^-publicport$/ ) {
     86        die "$0: option $option requries an argument\n" . $notes if !@ARGV;
     87        $publicport = shift @ARGV;;
    8288        next;
    8389    }
     
    285291
    286292my $wssport    = $https ? 443 : 80;
     293$wssport    = $publicport if $publicport;
    287294my $wsport     = 30777;
    288295my $zmqport    = 30778;
     
    440447    }
    441448} else {
    442     $$json{'mongo'}{'url'} = $mongourl;
     449    if ( $mongourl ) {
     450        $$json{'mongo'}{'url'} = $mongourl;
     451    } else {
     452        delete $$json{'mongo'};
     453    }
    443454}
    444455
     
    451462    }
    452463} else {
    453     $$json{'mongo'}{'cafile'} = $mongocafile;
     464    if ( $mongocafile ) {
     465        $$json{'mongo'}{'cafile'} = $mongocafile;
     466    } else {
     467        delete $$json{'mongo'};
     468    }
    454469}
    455470
Note: See TracChangeset for help on using the changeset viewer.