Skip copying environment/install-type files when checking existing installs. (#15876)
Austin S. Hemmelgarn committed
Sep 12, 2023 at 10:01 UTC
21539122d57536bd30bf92d9e62fa6cb25142c85
1 file changed
+3
-5
packaging/installer/kickstart.sh
+3
-5
@@ -881,9 +881,8 @@ detect_existing_install() {
881
if [ -n "${ndprefix}" ]; then
882
typefile="${ndprefix}/etc/netdata/.install-type"
883
if [ -r "${typefile}" ]; then
884
- run_as_root sh -c "cat \"${typefile}\" > \"${tmpdir}/install-type\""
884
# shellcheck disable=SC1090,SC1091
886
- . "${tmpdir}/install-type"
885
+ . "${typefile}"
886
else
887
INSTALL_TYPE="unknown"
888
fi
@@ -891,9 +890,8 @@ detect_existing_install() {
890
envfile="${ndprefix}/etc/netdata/.environment"
891
if [ "${INSTALL_TYPE}" = "unknown" ] || [ "${INSTALL_TYPE}" = "custom" ]; then
892
if [ -r "${envfile}" ]; then
894
- run_as_root sh -c "cat \"${envfile}\" > \"${tmpdir}/environment\""
895
- # shellcheck disable=SC1091
896
- . "${tmpdir}/environment"
893
+ # shellcheck disable=SC1090,SC1091
894
+ . "${envfile}"
895
if [ -n "${NETDATA_IS_STATIC_INSTALL}" ]; then
896
if [ "${NETDATA_IS_STATIC_INSTALL}" = "yes" ]; then
897
INSTALL_TYPE="legacy-static"