install-osrf.sh: update prod /etc/hosts during install
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 7 May 2021 21:34:09 +0000 (14:34 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 20 May 2021 17:05:09 +0000 (10:05 -0700)
deployment/install-osrf.sh

index 104bc84..5f60680 100755 (executable)
@@ -109,7 +109,7 @@ if [[ ! -n "$PROD" ]] ; then
       cat - /etc/hosts > /etc/hosts.new && mv /etc/hosts.new /etc/hosts
   fi
 else
-  echo 'WARNING: If this is a new production server, you will need to manually update /etc/hosts!'
+  cmp -s /etc/hosts ${SITKACONF}/files/etc/hosts/${HOSTNAME} || cp -b --suffix=.${TIMESTAMP} ${SITKACONF}/files/etc/hosts/${HOSTNAME} /etc/hosts
 fi
  
 # as root