Updating trace file after uploading 1.3.
[tails-test.git] / config / chroot_local-hooks / 12-install_browser_searchplugins
blobc7ffac289d663281f8dc40a7a346e7fda9309eb9
1 #!/bin/sh
3 set -e
5 echo "Install extra browser search plugins"
7 # Import the TBB_EXT variable
8 . /usr/local/lib/tails-shell-library/tor-browser.sh
10 LOCALIZED_PLUGINS_DIR=/usr/share/amnesia/browser/searchplugins/locale
12 for langpack in "${TBB_EXT}"/langpack-*@firefox.mozilla.org.xpi; do
13 locale="$(basename "${langpack}" | sed 's,^langpack-\([^@]\+\)@.*$,\1,')"
14 pkg=iceweasel-l10n-"$(echo ${locale} | tr 'A-Z' 'a-z')"
15 tmp="$(mktemp -d)"
16 cd "${tmp}"
17 apt-get download "${pkg}"
18 ar x "${pkg}"*.deb
19 path_to_searchplugins=etc/iceweasel/searchplugins/locale/"${locale}"
20 tar xf data.tar.* ./"${path_to_searchplugins}"
21 rm -f "${path_to_searchplugins}"/amazon*.xml \
22 "${path_to_searchplugins}"/bing*.xml \
23 "${path_to_searchplugins}"/eBay*.xml \
24 "${path_to_searchplugins}"/yahoo*.xml
25 mkdir -p "${LOCALIZED_PLUGINS_DIR}"/"${locale}"
26 cp "${path_to_searchplugins}"/* "${LOCALIZED_PLUGINS_DIR}"/"${locale}"
27 cd /
28 rm -r "${tmp}"
29 done