summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2022-04-22 17:49:44 +0200
committerGitHub <noreply@github.com>2022-04-22 17:49:44 +0200
commita8651305399a256871da875b66b6a661d80ef07a (patch)
treeea224c66b78f437a811f0f94e3dfcbc9127d05a6 /utils
parent4341ceceb48cb04a55e9f6faf6739886c655cc10 (diff)
parent463254e3b4afb721af8ee36511607ceaa28b9dc3 (diff)
Merge pull request #1141 from return42/fix-git-v2.35.2
[fix] since git v2.35.2 root can't read from unsafe repository
Diffstat (limited to 'utils')
-rwxr-xr-xutils/lib_install.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/lib_install.sh b/utils/lib_install.sh
index e8e3297c5..5d84c066f 100755
--- a/utils/lib_install.sh
+++ b/utils/lib_install.sh
@@ -92,6 +92,10 @@ init_SEARX_SRC_INIT_FILES(){
local fname
local msg=""
+ local _prefix=""
+ if [[ -n ${SUDO_USER} ]]; then
+ _prefix="sudo -u ${SUDO_USER}"
+ fi
# Monitor local modified files from the repository, only if the local file
# differs to the corresponding file in the instance
@@ -108,7 +112,7 @@ init_SEARX_SRC_INIT_FILES(){
msg="to update use: sudo -H ./utils/searx.sh install init-src"
fi
fi
- done <<< "$(git diff --name-only)"
+ done <<< "$($_prefix git diff --name-only)"
[ -n "$msg" ] && info_msg "$msg"
}