Skip to content

Commit

Permalink
Merge pull request searxng#266 from return42/fix-scripts
Browse files Browse the repository at this point in the history
[fix] utils/searx.sh install settings - do not eval the template
  • Loading branch information
return42 authored Aug 22, 2021
2 parents 29b4033 + 8ba4dc2 commit 183c856
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions utils/filtron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ install_rules() {
return
fi

if cmp --silent "${FILTRON_RULES}" "${FILTRON_RULES_TEMPLATE}"; then
info_msg "${FILTRON_RULES} is up to date with"
info_msg "${FILTRON_RULES_TEMPLATE}"
return
fi

rst_para "Diff between origin's rules file (+) and current (-):"
echo "${FILTRON_RULES}" "${FILTRON_RULES_TEMPLATE}"
$DIFF_CMD "${FILTRON_RULES}" "${FILTRON_RULES_TEMPLATE}"
Expand Down
3 changes: 2 additions & 1 deletion utils/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ install_template() {

if [[ "$do_eval" == "1" ]]; then
template_file="${CACHE}${dst}${variant}"
info_msg "BUILD template ${template_file}"
info_msg "BUILD ${template_file}"
info_msg "BUILD using template ${template_origin}"
if [[ -n ${SUDO_USER} ]]; then
sudo -u "${SUDO_USER}" mkdir -p "$(dirname "${template_file}")"
else
Expand Down
2 changes: 1 addition & 1 deletion utils/searx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ install_settings() {
fi

mkdir -p "$(dirname "${SEARX_SETTINGS_PATH}")"
install_template \
install_template --no-eval \
"${SEARX_SETTINGS_PATH}" \
"${SERVICE_USER}" "${SERVICE_GROUP}"
configure_searx
Expand Down

0 comments on commit 183c856

Please sign in to comment.