install-osrf.sh: init script for websocketd (and skip redundant zipfile downloads)
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 10 Jul 2018 18:20:22 +0000 (11:20 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 10 Jul 2018 18:20:22 +0000 (11:20 -0700)
deployment/install-osrf.sh

index 7545a46..6bee690 100755 (executable)
@@ -141,8 +141,11 @@ if [[ ! -n "$SKIP_WEBSOCKETS" ]] ; then
 
   # install websocketd
   [[ -e "/tmp/websocketd" ]] && rm /tmp/websocketd
-  su -c "cd /tmp && wget '${WEBSOCKETD_URL}' && unzip ${WEBSOCKETD_ZIP}" ${DEFAULT_USER}
+  [[ -e "/tmp/${WEBSOCKETD_ZIP}" ]] && su -c "cd /tmp && wget '${WEBSOCKETD_URL}' && unzip ${WEBSOCKETD_ZIP}" ${DEFAULT_USER}
   cp /tmp/websocketd /usr/local/bin/
+  WEBSOCKETD_INIT="/etc/init.d/websocketd"
+  [[ -e "${WEBSOCKETD_INIT}" ]] && mv ${WEBSOCKETD_INIT} ${WEBSOCKETD_INIT}.bak
+  cp ${SITKACONF}/files/${WEBSOCKETD_INIT} ${WEBSOCKETD_INIT}
 
   #echo "websockets is installed!"
 fi