2020-08-02 16:08:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -aeo pipefail
|
|
|
|
filename="$1"
|
|
|
|
url="$2"
|
|
|
|
tmpfile=$(mktemp /tmp/install_firefox_addon.XXXXXX)
|
|
|
|
|
2020-08-02 16:36:13 +00:00
|
|
|
readarray -t profiles <<<"$(sed -n 's/^Path=\(.*\)$/\1/p' $HOME/.mozilla/firefox/profiles.ini)"
|
|
|
|
|
2020-08-02 16:08:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
curl -sLo "$tmpfile" "$url"
|
2020-08-02 16:49:55 +00:00
|
|
|
for p in $(sed -n 's/^Path=\(.*\)$/\1/p' $HOME/.mozilla/firefox/profiles.ini);do
|
|
|
|
echo "Installing in profile $p"
|
|
|
|
cp "$tmpfile" "$HOME/.mozilla/firefox/$p/extensions/$filename"
|
2020-08-02 16:08:29 +00:00
|
|
|
done
|
|
|
|
rm "$tmpfile"
|