Skip to content

Commit

Permalink
fix: fix installer cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 28, 2020
1 parent 038e5a8 commit f2567c2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand All @@ -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"

0 comments on commit f2567c2

Please sign in to comment.