• Michael Kropat's avatar
    Improve hostname/IP default values · 43ef49c7
    Michael Kropat authored
    Default IP+hostname values were incorrect for my VPS provider. I
    improved the detection, which should give correct results results for
    almost any provider. Specific issues addressed:
    
    - icanhazip.com detection was only enabled in non-interactive mode
    - `hostname` is by convention a short (non-fqdn) name in Ubuntu
    - `hostname --fqdn` fails if provider does not pouplate `hosts` file
    - `hostname -i` fails if provider does not populate `hosts` file
    - `curl` without `--fail` will someday return crazy results
      when icanhazip.com returns 500 errors or similar
    43ef49c7
functions.sh 1.4 KB