From 996bb0acf4de929ab0e554e1f546f69051b6b07b Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 6 May 2022 11:38:44 +0200 Subject: [PATCH] feat: command updates --- container/manage.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/container/manage.sh b/container/manage.sh index 7417aba..0eda724 100644 --- a/container/manage.sh +++ b/container/manage.sh @@ -60,13 +60,13 @@ for NODE in $(kubectl get nodes -o custom-columns=name:metadata.name --no-header do echo "Managing node ${NODE}" echo "Downloading Scalyr agent installer" - if ! OUTPUT=$("${COMMAND[@]}" "${NODE}" -- "${SUDO_COMMAND}curl -sO https://www.scalyr.com/install-agent.sh" 2>&1) + if ! OUTPUT=$("${COMMAND[@]}" "${NODE}" -- "${SUDO_COMMAND}"curl -sO https://www.scalyr.com/install-agent.sh 2>&1) then echo -e "Can't download Scalyr installer:\n ${OUTPUT}" exit 1 fi echo "Installing Scalyr" - if ! OUTPUT=$("${COMMAND[@]}" "${NODE}" -- "${SUDO_COMMAND}bash install-agent.sh --set-api-key '${SCALYR_APIKEY}' --version '${SCALYR_VERSION}' --set-scalyr-server '${SCALYR_SERVER}'" 2>&1) + if ! OUTPUT=$("${COMMAND[@]}" "${NODE}" -- "${SUDO_COMMAND}"bash install-agent.sh --set-api-key "${SCALYR_APIKEY}" --version "${SCALYR_VERSION}" --set-scalyr-server "${SCALYR_SERVER}" 2>&1) then echo -e "Can't install Scalyr:\n ${OUTPUT}" exit 1 @@ -91,7 +91,7 @@ do exit 1 fi else - if ! OUTPUT=$(kubectl node-shell "${NODE}" -- sh -c 'cat > /etc/scalyr-agent-2/agent.d' <"${TEMPDIR}/${CONFIGFILE}" 2>&1) + if ! OUTPUT=$(kubectl node-shell "${NODE}" -- cat > /etc/scalyr-agent-2/agent.d <"${TEMPDIR}/${CONFIGFILE}" 2>&1) then echo -e "Can't copy configuration:\n ${OUTPUT}" exit 1 @@ -100,7 +100,7 @@ do done rm -rf "${TEMPDIR}" echo "Starting Scalyr Agent" - if ! OUTPUT=$("${COMMAND[@]}" "${NODE}" -- "${SUDO_COMMAND}systemctl restart scalyr-agent-2" 2>&1) + if ! OUTPUT=$("${COMMAND[@]}" "${NODE}" -- "${SUDO_COMMAND}"systemctl restart scalyr-agent-2 2>&1) then echo -e "Can't start scalyr agent:\n ${OUTPUT}" exit 1