From ed9b58dcb101505c81dfc4162672250d15462d98 Mon Sep 17 00:00:00 2001 From: Stefal Date: Sun, 24 Nov 2024 14:12:29 +0100 Subject: [PATCH] fix owner of extracted files if you use a different user when launching the install.sh script. before: If you launch the script as foo, with sudo, extracted files owner is the one who create the archive. after: If you launch the script as foo, with sudo, and RTKBASE_USER is basegnss, extracted files owner is basegnss. Fix #413 and fix #375 --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index a2c8bd9..df48047 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -289,7 +289,7 @@ install_rtkbase_bundled() { ARCHIVE=$(awk '/^__ARCHIVE__/ {print NR + 1; exit 0; }' "${0}") # Check if there is some content after __ARCHIVE__ marker (more than 100 lines) [[ $(sed -n '/^__ARCHIVE__/,$p' "${0}" | wc -l) -lt 100 ]] && echo "RTKBASE isn't bundled inside install.sh. Please choose another source" && exit 1 - sudo -u "${RTKBASE_USER}" tail -n+${ARCHIVE} "${0}" | tar xpJv && \ + sudo -u "${RTKBASE_USER}" tail -n+${ARCHIVE} "${0}" | sudo -u "${RTKBASE_USER}" tar xpJv && \ _add_rtkbase_path_to_environment }