From f2567c26fea07e570fd8da94e808e30510d2c5e2 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Dec 2020 14:55:02 +0100 Subject: [PATCH] fix: fix installer cleaning --- installer/install.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/installer/install.sh b/installer/install.sh index 21eb10f..9e5034c 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -30,8 +30,15 @@ fi echo "=> Found release: ${RELEASE}" echo "=> Found download url: ${DOWNLOAD_URL}" -cd /opt -echo "Downloading ${DOWNLOAD_URL}..." +echo "Removing old releases..." +rm -Rf /opt/log_proxy-linux64-v* >/dev/null 2>&1 +rm -Rf /opt/log_proxy >/dev/null 2>&1 +rm -Rf /opt/metwork-framework-log_proxy* >/dev/null 2>&1 +rm -f "${PREFIX}/bin/log_proxy" >/dev/null 2>&1 +rm -f "${PREFIX}/bin/log_proxy_wrapper" >/dev/null 2>&1 + +cd "${TMPDIR:-/tmp}" || exit 1 +echo "Downloading ${DOWNLOAD_URL} into $(pwd)/${ORG}-${REPO}-${RELEASE}.tar.gz..." curl "${CURL_OPTS}" "${DOWNLOAD_URL}" >"${ORG}-${REPO}-${RELEASE}.tar.gz" echo "Installing..." zcat "${ORG}-${REPO}-${RELEASE}.tar.gz" |tar xf - @@ -40,5 +47,7 @@ for F in log_proxy log_proxy_wrapper; do cp -f "log_proxy-linux64-${RELEASE}/${F}" "${PREFIX}/bin/" chmod a+rx "${PREFIX}/bin/${F}" done +echo "Cleaning..." rm -f "log_proxy-linux64-${RELEASE}.tar.gz" +rm -Rf "log_proxy-linux64-${RELEASE}" echo "Done"