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() {
# Workaround bug #8036 by copying any localized search plugins into
# the profile.
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@')
if [ "${TBB_LOCALE}" = en-US ]; then
if [ "${locale}" = en-US ]; then
return
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
mkdir -p "${PROFILE}"/searchplugins
# The plugins do not load if they are symlinks
......
Markdown is supported
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