Changeset 1395 in genapp


Ignore:
Timestamp:
Feb 9, 2018, 2:56:11 PM (4 years ago)
Author:
ehb
Message:

fix for user specified hostname

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbin/setconfig.pl

    r1363 r1395  
    3131usage: $0
    3232
    33 sets up $GENAPP/config.json
     33sets up $gb/config.json
    3434
    3535options
     
    234234}
    235235
    236 $hostname = `host $hostip` if !$hostname;
    237 chomp $hostname;
    238 if ( $hostname =~ /(not found|no PTR record)/ ) {
    239     $hostname = $hostip;
    240 } else {
    241     ( $hostname ) = $hostname =~ /\s+(\S+)\.$/;
     236if ( !$hostname ) {
     237    $hostname = `host $hostip` if !$hostname;
     238    chomp $hostname;
     239    if ( $hostname =~ /(not found|no PTR record)/ ) {
     240        $hostname = $hostip;
     241    } else {
     242        ( $hostname ) = $hostname =~ /\s+(\S+)\.$/;
     243    }
    242244}
    243245
Note: See TracChangeset for help on using the changeset viewer.