github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/images/scripts/centos/networking.sh (about)

     1  #!/bin/sh -eux
     2  
     3  case "$PACKER_BUILDER_TYPE" in
     4  
     5  virtualbox-iso|virtualbox-ovf)
     6      major_version="`sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release | awk -F. '{print $1}'`";
     7  
     8      if [ "$major_version" -ge 6 ]; then
     9          # Fix slow DNS:
    10          # Add 'single-request-reopen' so it is included when /etc/resolv.conf is
    11          # generated
    12          # https://access.redhat.com/site/solutions/58625 (subscription required)
    13          echo 'RES_OPTIONS="single-request-reopen"' >>/etc/sysconfig/network;
    14          service network restart;
    15          echo 'Slow DNS fix applied (single-request-reopen)';
    16      fi
    17      ;;
    18  
    19  esac