Commit db2517c6 authored by Tails developers's avatar Tails developers
Browse files

Use local variables in shell functions.

parent e9979c95
...@@ -33,12 +33,13 @@ tor_has_bootstrapped() { ...@@ -33,12 +33,13 @@ tor_has_bootstrapped() {
# Workaround bug #8036 by copying any localized search plugins into # Workaround bug #8036 by copying any localized search plugins into
# the profile. # the profile.
enable_localized_searchplugins() { enable_localized_searchplugins() {
TBB_LOCALE=$(cat /var/lib/tails-user-session/browser-locale.js | \ local locale
locale=$(cat /var/lib/tails-user-session/browser-locale.js | \
sed 's@^pref("general\.useragent\.locale", "\([^"]*\)");$@\1@') sed 's@^pref("general\.useragent\.locale", "\([^"]*\)");$@\1@')
if [ "${TBB_LOCALE}" = en-US ]; then if [ "${locale}" = en-US ]; then
return return
fi fi
PLUGIN_DIR="${TBB_INSTALL}"/distribution/searchplugins/locale/${TBB_LOCALE} PLUGIN_DIR="${TBB_INSTALL}"/distribution/searchplugins/locale/${locale}
if [ ! -e "${PROFILE}"/searchplugins ] && [ -d "${PLUGIN_DIR}" ]; then if [ ! -e "${PROFILE}"/searchplugins ] && [ -d "${PLUGIN_DIR}" ]; then
mkdir -p "${PROFILE}"/searchplugins mkdir -p "${PROFILE}"/searchplugins
# The plugins do not load if they are symlinks # The plugins do not load if they are symlinks
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment