From 51c1939ac8a5f2f840ddd6cea2bd9ac0c24efdd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 6 Dec 2017 15:24:37 +0000 Subject: [PATCH] fix for macosx bash --- scripts/bootstrap.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 40ea382..3c1fd73 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -1099,11 +1099,12 @@ to --condition AX_USE_NODEJS nodejs/etc/${PACKAGE_NAME}.json < /var/run/${PACKAGE_NAME}.pid # there are some useful defaults # do not edit this file, overwrite values in /etc/default/${PACKAGE_NAME} - EXEC_${PACKAGE_NAME^^}="/usr/bin/nodejs /usr/share/${PACKAGE_NAME}/nodejs/${PACKAGE_NAME}" - ${PACKAGE_NAME^^}_LOG="/var/log/${PACKAGE_NAME}.log" - ${PACKAGE_NAME^^}_USER="${PACKAGE_NAME}" - ${PACKAGE_NAME^^}_PORT="" + EXEC_${PACKAGE_NAME_UPPER}="/usr/bin/nodejs /usr/share/${PACKAGE_NAME}/nodejs/${PACKAGE_NAME}" + ${PACKAGE_NAME_UPPER}_LOG="/var/log/${PACKAGE_NAME}.log" + ${PACKAGE_NAME_UPPER}_USER="${PACKAGE_NAME}" + ${PACKAGE_NAME_UPPER}_PORT="" [ -r /etc/default/${PACKAGE_NAME} ] && . /etc/default/${PACKAGE_NAME} - if test -n "\${${PACKAGE_NAME^^}_USER}"; then - exec sudo -u "\${${PACKAGE_NAME^^}_USER}" \${EXEC_${PACKAGE_NAME^^}} \${${PACKAGE_NAME^^}_PORT} >> \${${PACKAGE_NAME^^}_LOG} 2>&1 + if test -n "\${${PACKAGE_NAME_UPPER}_USER}"; then + exec sudo -u "\${${PACKAGE_NAME_UPPER}_USER}" \${EXEC_${PACKAGE_NAME_UPPER}} \${${PACKAGE_NAME_UPPER}_PORT} >> \${${PACKAGE_NAME_UPPER}_LOG} 2>&1 else - exec \${EXEC_${PACKAGE_NAME^^}} \${${PACKAGE_NAME^^}_PORT} >> \${${PACKAGE_NAME^^}_LOG} 2>&1 + exec \${EXEC_${PACKAGE_NAME_UPPER}} \${${PACKAGE_NAME_UPPER}_PORT} >> \${${PACKAGE_NAME_UPPER}_LOG} 2>&1 fi end script pre-start script - ${PACKAGE_NAME^^}_LOG="/var/log/${PACKAGE_NAME}.log" + ${PACKAGE_NAME_UPPER}_LOG="/var/log/${PACKAGE_NAME}.log" [ -r /etc/default/${PACKAGE_NAME} ] && . /etc/default/${PACKAGE_NAME} # Date format same as (new Date()).toISOString() for consistency - echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> \${${PACKAGE_NAME^^}_LOG} + echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> \${${PACKAGE_NAME_UPPER}_LOG} end script pre-stop script - ${PACKAGE_NAME^^}_LOG="/var/log/${PACKAGE_NAME}.log" + ${PACKAGE_NAME_UPPER}_LOG="/var/log/${PACKAGE_NAME}.log" [ -r /etc/default/${PACKAGE_NAME} ] && . /etc/default/${PACKAGE_NAME} rm /var/run/${PACKAGE_NAME}.pid - echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> \${${PACKAGE_NAME^^}_LOG} + echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> \${${PACKAGE_NAME_UPPER}_LOG} end script EOF to --condition AX_USE_NODEJS nodejs/etc/systemd/system/${PACKAGE_NAME}.service <